Some Commands on Linux

To put history of commands in a file :


This will create file on desktop containing the history of commands.

To create a file in terminal

$echo>filename.txt or cat>filename.txt

To write in file along with create:

$echo hello how r u >filename.txt

It will create a file filename.txt along with the text in it : hello how r u

To resume any download:

$wget -c any_ftp_url

To store the output of C++ program in a file:

$ ./a.out>filename.txt

To Create a tar.gz folder

$ tar -zcvf archive-name.tar.gz directory-name


  • -z: Compress archive using gzip program
  • -c: Create archive
  • -v: Verbose i.e display progress while creating archive
  • -f: Archive File name

To shut down computer:

$ sudo shutdown 0

To reboot computer:

$  sudo reboot

To clear the terminal:




About Priyanka Kapoor

Simple, Hardworking & friendly.....
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s