Basic Commands in linux

 Linux commands:

Listing files(ls): to see the list of files on UNIX or Linux system.

Ls- R: shows all the files not only in directories but also sub directories.

Ls -al - gives detailed information of the files.

ls - a - command to view hidden files.


Creating and viewing files:

cat - commands is used to display text files. It is also used for copying, combining and creating new text files.

cat filename - to view the file created.


Deleting files

Cat command - It will only show a message when something goes wrong or when an error has occurred.

 cat sample - to view the new combo file "sample".

rm - removes files from the system without confirmation.

mv - to move a file to different directory. The command needs super user/ root user permission. Currently the command is executed as a standard user.

sudo - used to overcome error.


sudo program allows regular users to run programs with the security privileges of the super user or root user.


Moving and renaming files:

sudo command ask for password authentication.


Re-naming files:

mv can also be used for renaming file. 

Syntax: mv filename newfilename.


Directory ManipulationsL

mkdir - command for creating directories on a Linux operating system. 

To create a directory in a different location other than 'Home directory' i.e., create a directory 'Music' under '/tmp' directory, use mkdir /tmp/MUSIC.


Removing directories

rmdir - used to remove directory.


Renaming directories

mv command can also be used for renaming directories.


Search command

grep (global regular expression print): It is used to search text in files and print that matches the given pattern.

find: It is used to search files and directories.


Other important Commands

History - it shows all the commands used in the past for the current terminal session. Helps user refer to the old commands entered and re-use them in again.

clear - clears all the clutters on the terminal and gives you a clean window to work on.


Text Editor:

vi (Visual Editor): It is terminal based text editor that you can use to write any files.

vi or vim can be used to work.


Summary



Comments

Popular posts from this blog

Linux Network and Process Management