You are on page 1of 17

Command to know the DATE

$ date

Command to print some text

$ echo

Command are case sensitive

Command for creating files:

$ cat > shopping_list


Command for Displaying content of files

$ cat shopping_list
Command for deleting file
$ rm shopping_list

Command to copy the content of one file to another file

$ cp CV.pdf old-CV.pdf
Command to rename the file

$ mv commitee_minutes.txt committee_minutes.txt
Command to list files
$ ls /abc/def/ghi/

Command to see your current directory


$ pwd
Command to change the current directory
$ cd /abc/def/ghi/

Command to get back in your home directory


$ cd

Command to make directory:

$ mkdir Accounts
Command to remove directory

$ rmdir OldAccounts

Command to remove directory using recursive r


$ rm -r OldAccounts
Command to change directory usind special Dot Directories:
$ cd ..
$ cd .
$ cd ../../../
Command to list files using Special Dot Directories.

$ ls ..
$ ls .
$ls ../../../
Command to display all hidden files.
$ ls -a

Command to change directory using “ ~ ”


$ cd /documents/

Command to look files in the system.

$ locate mkdir
Command to list files with more information
$ ls -l

Command to delete several files at once


$ rm abc.txt def.txt jhi.doc
Command to make directories at once
$ mkdir Accounts Reports
Command to list files one after another
$ cat abc.txt def.txt
Put spaces in the names of files using single quotes:
$ cat ’* abc .txt *’
$ cat ' c c e '

Access the content of the variables


Quoting
Manipulating Parameter and Environment Variables

Making file Executable


chmod +x (filename)
Conditions

if test -f fred.c
then
...
fi

If , elif , else using following condition type

if [ -f fred.c ]
then
...
fi

You might also like