Sitemap
Geek Culture

A new tech publication by Start it up (https://medium.com/swlh).

Shell Commands You Should Have Memorized Yesterday

6 min readFeb 4, 2021

--

1. Get to know where you are with “pwd”

$ pwd

2. Listing files and directories with “ls”

$ ls
$ ls -l
$ls -al

3. Change directories with “cd”

$ cd
$ cd my-directory
$ cd shashank/projects

4. Understand the dot “.” and double dots “..”

$ open .
$ cd ..

5. Create Directories with “mkdir”

$ mkdir my-new-directory
$ mkdir /users/shashank/my-new-directory

6. Crete a new file with “touch”

$ touch log.txt dump.csv 

7. Add content to file with “>” and “>>”

$ file1 > file2
$ file1 >> file2

8. View the file contents with “cat”

$ cat file1 file2

9. Rename or move with “mv”

$ mv file1 my-directory
$ file1 newfile

10. Delete files and folders with “rm” and “rmdir”

$ rm filename
$ rmdir my-directory
$ rm -rf my-directory

11. Use the power of wildcards

$ ls -al *.txt
$ ls l?st.sh
$ ls l[abdcio]st.sh

10. Clean up the terminal window with “clear”

$ clear

11. Use the “man” command to list a manual for any command

$ man ls

Bonus: Understand the power of TAB autocomplete and Arrow keys history

Where to go from here

--

--

Shashank Katte
Shashank Katte

Written by Shashank Katte

Full-Stack Developer and Agile-DevOps Coach from Toronto. I write about programming, technology and leadership | katte.io

No responses yet