Ubuntu has been my main operating system for over a year now. Though it may not be my main choice, for very superficial reason, I’ve come to warm up to it when it comes to development.
Linux operates on commands… super convenient especially when you know which commands do what.
Anyway, here are some commands I have found myself using almost everyday I’m working with Ubuntu.
This is first and most important command. Any command that needs root permission is preceded by this command.
This is used when you want to see what is in a directory. It displays the content of the directory you are currently working in. (It also basically means list)
This command creates a directory or folder. It is followed by the name intended for the new folder.
The rm command deletes a file or a folder. You have to specify the name of the file/ folder after the rm command.
The apt-get command installs, upgrades and removes any software.
apt-get install 'software-name'
apt-get remove 'package-name'
cd command changes into or out of a directory. For instance to leave a directory `cd ..` while to get into one
`cd [directory name/path]`
cp allows a user to run copy-paste a file. First identify the file you want to copy then the destination it will be pasted in.
`cp [file-to-copy] [file-to-paste]`
Sometimes you can’t remember the exact location of a file. The grep command makes it easier to find this file based on keywords provided.
From its name, this commands shuts down your computer. Include the command `sudo` at the beginning for root permission.
cat displays the text inside a file.
This command changes the location of a file or renames it.
`mv [filename] [new file name]`
To change location:
`mv [filename] [path to destination]`
This command changes the permissions of files. This can be done only by the file owner or a privileged user.
`chmod option permissions filename`
Owners include: User (u), Group(g) and Others(o)
Permissions include: Read(r)or(4), Write(w)or(2), Execute(x)or(1), No Permission(0)
To make it less complex, say you want to change the permissions of a file for the user to read, write and execute; members of your group to read and execute; and other to only read.
The command would look like this:
`chmod u=rwx, g=rx, o=r myfile`
Terminates or ends a script and goes back to the original script.
Shuts down process. Usually done by the admin.
Lists all open files.
Provides information about protocols in use and current TCP/IP network connection.
Displays the name of the current working directory.
Displays the status of current processes in the system.
Compresses and decompresses files.
To compress :
`gzip -d filename.odt.gz`
Changes user and group ownership of a file.
`chown [user name of new owner] [target file]`