Wednesday, 30 April 2014

useful Linux Commands

Command terminal

1. To display file content 
cat 
head
tail
vi 
note: vi is the text editor

2. make directory - mkdir

3. create new text file-
vi filename
it will open in the command terminal 
write the content of the file and finally enter esc and :wq

4. To know the current working directory address
pwd

5. move file from one location to other
mv /filelocation/filename newlocation/

6. various ways of file listing 
ls -r  reverses the listing order
ls -s  gives sizes of the files
ls -C  lists files in col
ls -R  recursively lists files in the current directories and all subdirectories
ls -p subdirectories
ls -a   include all files including files whose names start with a period
ls -c   list files by date of creation
ls -l    list files in long form: links, owner, size. date and time of last change

7.Print my login name
whoiam

8.  to display date
date

9. to alter system date
date -s '06/23/2009 10:30:00'

10. display calender
cal

11. display calender of particular month
cal 9 2011

12. display date of a day
date -d -fri

No comments:

Post a Comment