8 Basic Intermediate Commands for Every Linux User | Part - 2


Linux Intermediate Commands

Let's learn the more must know Linux command. You are the beginner or new user then you have need of this post to know more about command. Read the previous part of this command click here.

          C language tutorials for beginners

Intermediate Commands for Every Linux User

1.echo

"echo" is a command that helps us move some data, usually text into a file. For example, if you want to create a new text file or add into an already made text file, then you just need to type in "echo hello, my name is Rahul>>new.txt". You do not need to separate the spaces by using the backward slash here because we put in two triangular brackets when we finish what we need to write.



2.cat

The cat command is used to display the contents of a file, usually used to easily view programs.

cat command

3. zip, unzip

zip is a command used to compress files into a zip archive, unzip is used to extract files from a zip archive.

                  Download Hacking E-Books


4. nano, vi, jed

nano and vi are already installed text editors in the Linux command line. nano is a good text editor which denotes keyword with color and recognize most of the languages. Vi is simpler than nano. You can create a new file named "check.txt", you can create it by using the command "nono check.txt". You can save your file after editing by using the sequence. ctrl-X, then Y (or N for no). In my observation, using nano for HTML editing doesn't seem so good, because of its color, so I recommend Jed text editor. We will come to installing packages soon. 


nano and vi



5. sudo

sudo is a widely used command in the Linux terminal. sudo stands for "SuperUser Do". So, if we want any command to be done with administrative or root privileges, then you can use the sudo command. For Example, if you want to edit a file like viz.alsa-base.conf which needs root permission, you can use the command -sudo nano alsa-base.conf. You can enter the root command line using the command "sudo bash", then type in your user password. You can also use the "su" to do this, but you need to set a root password before that. For that, you can use the command "sudo passwd" (it is passwd, not password). Then type in the new rot password.

  Download let us c E-Book - by Yashwant Kanetkar


 sudo stands for "SuperUser Do"



6. df

The df command is used to see the available disk space in each of the partitions in your system. You can just type in df in the command line and you can see each mounted partition and they're used/available space in % and in KBs. If you want it shown in megabytes, you can use the command "df-m"



df command is used to see the available disk space


7. du

du is a command to know the disk usage of a file in your system. If you want to know the disk usage for a particular folder or file in Linux, then you can type in the command df and the name of the folder or file. For example, if you want to know the disk space used by the folder Documents in Linux, you can use the command "du Documents". You can also use the command "ls-lah" to view the sizes of all the files in a folder.


              Download Turbo C++ Program Compiler



disk usage of a file in your system


8. tar

tar is a command used to work with tarballs (or files compressed in a tarball archive) in the Linux command line. It has a long list uses. It can be used to compress and uncompress different type of tar archives like .tar, .tar-gz, .tat-bz2. etc. It works on the basis of the arguments given to it. For example, tar -cvf for creating a .tar archive, -xvfto untar a tar archive, -tvf to list the contents of the archive.etc.

Post a Comment

1 Comments

Ask Me Everything About Programming.