Linux Bash commands useful stuff

Assign a value to a variable and show it on output

$ someVar = “hello world!”

$ echo $someVar

Assign a command into a variable and run it

$ someVar = “ps -a”

$ $someVar   (runs the command contained in the string)

Find command’s actual path

which ls          –> shows /usr/bin/ls



ls -l  –> can give access denied if you’re in windows/system32 folder

cd /home  -> goto ubuntu default home folder.

dir -l  –> works same as ls -l


Leave a Reply