DEV Community

Mahbub Ferdous Bijoy
Mahbub Ferdous Bijoy

Posted on

Day-1.Linux Basic CLI(Command line interface)

  1. Present working directory(pwd):
$ pwd

Enter fullscreen mode Exit fullscreen mode
  1. change directory(cd):
$ cd "dirName or path"

Enter fullscreen mode Exit fullscreen mode
  1. back one step directory(cd):
$ cd .. 

Enter fullscreen mode Exit fullscreen mode
  1. back root directory(cd):
$ cd /

Enter fullscreen mode Exit fullscreen mode
  1. from user to direct jump to the file (cd~):
$ cd~

Enter fullscreen mode Exit fullscreen mode
  1. List file (ls):
$ ls

Enter fullscreen mode Exit fullscreen mode
  1. List file with hidden (ls):
$ ls -a

Enter fullscreen mode Exit fullscreen mode
  1. List file with file permission details (ls):
$ ls -l

Enter fullscreen mode Exit fullscreen mode
  1. List file with permission and hidden files (ls):
$ ls -al

Enter fullscreen mode Exit fullscreen mode
  1. Make directory(mkdir):
$ mkdir "dirName"

Enter fullscreen mode Exit fullscreen mode
  1. create subdirectory at a time(mkdir):
$ mkdir -p dirM/2ndDir/lastDir

Enter fullscreen mode Exit fullscreen mode
  1. make any file(touch):
$ touch fileName.txt 

Enter fullscreen mode Exit fullscreen mode
  1. to check description of a file(file):
$ file fileName.jpg 

Enter fullscreen mode Exit fullscreen mode
  1. show the content of a file(cat,less):
$ cat fileName
$ less fileName

Enter fullscreen mode Exit fullscreen mode
  1. show any long file with head part or tail part(head,tail):
$ head fileName
$ tail fileName
Enter fullscreen mode Exit fullscreen mode
  1. clear terminal (clear):
$ clear 

Enter fullscreen mode Exit fullscreen mode
  1. to see last command you write(history):
$ history

Enter fullscreen mode Exit fullscreen mode
  1. copying file (cp):
$ cp fileNmae pathwithFilename
$ cp *.jpg /user/desktop/picture 

Enter fullscreen mode Exit fullscreen mode
  1. rename file and directory (mv):
$ mv oldFile newFile
$ mv oldDir newDir

Enter fullscreen mode Exit fullscreen mode
  1. move file(mv):
$ mv fileName /home/desktop/files
$ mv file1 file2 /files

Enter fullscreen mode Exit fullscreen mode
  1. remove file and directory(rm):
$ rm fileName
$ rmdir dirName
$ rm -r dirName
$ rm *.text 

Enter fullscreen mode Exit fullscreen mode
  1. know any commands manual(man):
$ man mkdir

Enter fullscreen mode Exit fullscreen mode
  1. find some file(find):
$ find /home -name fileName

Enter fullscreen mode Exit fullscreen mode
  1. see date and time:
$ date 
$ time 

Enter fullscreen mode Exit fullscreen mode
  1. want to see my ssh key:
$ cat ~/.ssh/id_rsa.pub

Enter fullscreen mode Exit fullscreen mode
  1. to show a short description about your desire command(whatis):
$ whatis cat

Enter fullscreen mode Exit fullscreen mode
  1. for exit from terminal(exit):
$ exit 
$ logout

Enter fullscreen mode Exit fullscreen mode
  1. locate a program file from Users file using which command:
$ which bash 

Enter fullscreen mode Exit fullscreen mode
  1. who is in the system to check by using whoami command:
$ whoami

Enter fullscreen mode Exit fullscreen mode

Top comments (0)