Upgrade to remove ads
Linux Commands for Everyday Use
Linux survival skills
Terms in this set (40)
List the contents of the current folder or directory. Similar to dir command in Windows
List files in current folder in long format. You can see permissions and size of each file
Print (to screen) the name of the current folder you are in.
This is good to do before you do something drasting and irreversible like rm (remove or delete)
List the ids of all running processes started by you (the currently logged user)
ps - ef
Like the ps command, but this one lists processes that have been started by users other than you.
It also list some other info about the processes e.g. uid,cpu usage, controlling tty etc
ls | grep
List files in the cur dir matching the string expression (regular expression match)
delete a file whose name matches filename
delete everything in the current working folder that is not a folder itself
CAREFUL. do a pwd first before doing this. Make sure you are in the right folder before doing something potentially disastrous
similar to rm *, but this one only deletes files that matches expression
This will delete the following files:
Forcibly stop a running process (given by the pid). Usually this command comes after the ps command.
ps -ef | grep
display the contents of a file. Output is to stdio (screen). This will not open the file for editing, simply for display
Creates a file. If the filename specified is already existing, it will update the creation date attribute of the filename
Find out which processes is hogging the CPU and memory resources of the PC
Find out the username of the currently logged in user
Borrow the elevated privilege of root, just for one command. You will not become root, but you will be allowed to execute the command as if you were root.
It will ask for password (your password, not root's) so that your action can be logged
. You need to know his password though.
login as root. You need to know root's password
Change your own password
sudo passwd [username]
Change the the password of a particular user. You need sudo because changing a password requires root privilege
sudo passwd root
Change the password of root.
In Ubuntu, right after installation, you cannot login as root. So you may have to do to this if you want to be able to "su root"
Find out how much disk space is still left on your hard drive
Find out the name of Operating system. If you want to find out whether you are using Debian, RedHat, OSX, BSD etc
Clear the terminal screen
. Go to the folder specified
If you enter just cd (from anywhere you are) and then press ENTER, you will go to your HOME folder. It is functionally the same as
same as cd
Create a directory on the current folder
lp -d "Printer Name" filename
Prints the contents of "filename" to a specified printer
What you want to print
Print to stdio whatever you want to print
Print to screen the value of variable $VARNAME.
The $ sign in UNIX/Linux is used to denote a variable. So if you want to know what it contains, simply use echo
Find out what kind of shell you are using, whether Bourne, BASH, KSH or CSH
Change the permissions of a file. A file has three sets of read-write-execute permissions
U G O
You can change this using chmod e.g.
chmod ugo-x hello . The permission of hello after this command will be
To add permissions, use the + sign
change the owner of a file
chown ted hello
Transfers the ownership of hello to a user named ted
Copy a file
cp hello.txt hello2.txt
Copies the file hello.txt to a new file named hello2.txt
cat hello.txt > hello2.txt
> is called a redirection operator. It directs the output of the command to a file. In this case, the contents of hello.txt was read, but instead of sending it to the screen, it was redirected to another file named hello2.txt
This is has the same effect as "cp hello.txt hello2.txt"
Soft linking [finish this]
name of executable file
Find out exactly where an executable file.
Login to a remote server securely
After that, it's like working on a local terminal, only, remotely
myname@somehost -p 222
option allows you to specify a port number other than the default which is
THIS SET IS OFTEN IN FOLDERS WITH...
Basic Linux Commands
Linux+ LX0-101 Chapter 1: Exploring Linux Command-…
Linux Command-Line Cheat Sheet
Linux+ Final Exam Study Guide
YOU MIGHT ALSO LIKE...
LX0-101 Practice Exam 3
OTHER SETS BY THIS CREATOR
Declarative Event Handling
Android Basic Concepts