DEV Community

Cover image for My top terminal commands
Rembrandt Reyes (He/Him)
Rembrandt Reyes (He/Him)

Posted on

26 9

My top terminal commands

I was recently watching a video that was walking beginners through terminal commands and they listed over 50 commands that you should use. 50!? Who uses more than 10 terminal commands?

The ones that I use (off the top of my head)

1) pwd

The command pwd stands for "print working directory" which gives your current location in terminal
pwd

2) cd directory

The command cd stands for "change directory" which allows you to navigate through the terminal.
cd

3) ls

The command ls will list all the computer files in your current directory.
ls

4) mkdir folder

The command mkdir will create a new folder in your current directory.
mkdir

5) clear

The command clear will... you guessed it, clear your terminal.

6) 🐈 aka cat file

The command cat will return the contents of a file.
cat
If you cat command a directory it will let you know that as well.
catDir

7) touch file

The command touch file will create a new file in your current directory.
touch

8) rm file

The command rm file will remove the file from your current directory
rm

There are some special options that you can pass into some of these commands but for now, the basics are all that is needed to be a hacker!

Some honorable mentions - these are commands that I use here and there.

  • mv - move files or rename files
  • sudo - "SuperUser Do", this enables admin/root permissions, only use this if you know what you are doing
  • grep - search for something in a file
  • ping - check your connectivity status to a server.
  • echo - used to move data into a file

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (17)

Collapse
 
vlasales profile image
  • vim - to edit anything
  • sed - to filter and update
  • awk - to manage table data
  • alias - to create own command acronyms
  • git - to version controll
  • find - to search files
  • make - to run tasks
  • xmllint, xsltproc, xqilla, xmlstarlet - to working with XML
  • jq - to working with JSON
  • php, python3, gcc, clisp, bc, octave ... compilers and interpreters
Collapse
 
rembrandtreyes profile image
Rembrandt Reyes (He/Him) β€’

vim, alias, & git are ones I use often as well. Can't say the same for the other two (awk & sed)

Collapse
 
vlasales profile image
Vlastimil Pospichal β€’

They are very useful for working with huge files.

Collapse
 
hamzajd profile image
Hamza Jadid β€’

history | grep "search text"

Collapse
 
tanami profile image
Tanami β€’

no love for find? it's so powerful!

Collapse
 
rembrandtreyes profile image
Rembrandt Reyes (He/Him) β€’

I have honestly rarely/never used it πŸ˜‚

Collapse
 
wicked7000 profile image
Wicked β€’

Ive been making a lot of use out of these commands lately: (I'll admit they might not be a frequent use type of command but helpful to know)

ps -elf 
top

The first to check if prcoesses im expecting to run are running. Sometimes combined with a grep to search for a specific part of a command. And then top to see what kinda usage those processes are producing.

Collapse
 
rembrandtreyes profile image
Rembrandt Reyes (He/Him) β€’

πŸ‘ Don't use these often, but they do come in handy.

Collapse
 
____marcell profile image
Marcell Cruz β€’

Great article, my favorite

grep -ril 'search_string' ./folder

Collapse
 
rembrandtreyes profile image
Rembrandt Reyes (He/Him) β€’

One of my favorite commands lsof -nP -i4TCP | grep LISTEN to see what open connections I have.

Collapse
 
drhyde profile image
David Cantrell β€’

In order from most- to least-used, the top 20 on one of my machines are ...

mutt, ps, ls, cd, ssh, vi, ping, find, host, grep, which, rm, cat, nslookup, man, history, whois, tree, touch, mount, ...

... and that's ignoring everything that's used from within any of my own scripts, and only counting the first command on a line, it ignores anything that might follow in a pipeline such as awk, sed, sort, uniq, tac, head, tail, cut, ...

... and that also ignores anything used in development (which I generally do on a different machine) such as git, cc, make, perl, python, go, ...

Collapse
 
rembrandtreyes profile image
Rembrandt Reyes (He/Him) β€’

Yeah if I introduce development commands then git would be the number 1 command that I use.

Collapse
 
pengeszikra profile image
Peter Vivo β€’

history 0 | grep "..."

Collapse
 
realabbas profile image
Ali Abbas β€’

cd, clear, touch, ls, rm they are the most used

Collapse
 
fairen profile image
Fairen β€’

Greate summary !
You could also use fasd to replace cd and use tail -f <some_file> when the file is too long for cat.

Collapse
 
rembrandtreyes profile image
Rembrandt Reyes (He/Him) β€’

Interesting command, thanks for the share!

Collapse
 
akramnarejo profile image
Akram Narejo β€’

it's very few bro but again it's good that u have shared.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay