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

AWS Q Developer image

Your AI Code Assistant

Implement features, document your code, or refactor your projects.
Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay