cp <source-file> <destination-file>
Copies the file
scp <source-file> <destination-file>
Copies file from one host machine to another host machine.
mv <source-file> <destination-file>
Moves the file/folder from one place to other.
Creates the file
Creates the directory. If you want to create a chain of parent and child directory you can use with ‘-p’ option. e.g
mkdir -p code/reference, this command will create
Deletes the file. If use with -r option, it recursively deletes the file and child directory
Deletes the empty directory.
grep <pattern> <file-name>
Looks for the pattern in given file.
Prints the content of the file on the console.
find <directory -name <file-name>
This try to find file/directory in the given directory. Regular expression can be used for the file name.
Lists the files/directories present in the given directory.
Prints the the path of the current directory.
jar -tvf <jar-file-name>
Lists the files present in the jar file.
This provides you the manual of the command. Very handy, if you want to know about the command options.
sudo apt-get install <package-name>
Installs the package.
sudo dpkg -i <package-name>
Installs the package.
sudo dpkg -r <package-name>
Removes the package.
- If you are using
gitfor source control then check these git commands.
Downloads the file from the specified URL.
Dumps the network packets on the console. Very handy when you are debugging the network application.
This command shows you the HTTP ouput of the url. This command is similar to wget command.
Lists the directory structure in tree form. If the command doesn’t work then install it using this command
sudo apt-get install tree. Sometime handy when you want to see what all files have been created by the application in a directory.
chmod [options] <file-name>
changes the file permissions.
service <service-name> start
Starts the service, but should have sudo permission.
service <service-name> stop
Stops the service but should have sudo permission.
Ctrl + Alt + T
Launches the terminal
Ctrl + L
to clean the screen as good as typing “clear”
Takes you to beginning of the command
Erase the command
Takes you to end of the command
Copies the select string from terminal
Pastes the string on the terminal
Prints the few lines from the beginning of the file
Prints the file content in page-by-page basis.
Prints the few lines from the end of the file. If the command is used with -f , the output get appended data as the file grows. Helpful when you try to see the log file.
alias <customized_command>='<formal command>'
Really handy command to rename the long command to customizable short command.
echo $<Environment variable>
Prints the environment variables value.
Reports on your system’s network interfaces.
Helps to configure a network interface
Checks the file system.
Help to Execute Commands with elevated privileges
Lists the current running process on your system.
kill -9 processid
Kills the specified process.
if you are on GNOME; Shows the calculator.
Shows the Calendar
Shows the current date and time
Commands for fun
Checkout yourself what it does.
If the command is not found then install it using this command
sudo apt-get install cowsay
alt+f2 "free the fish"
If you use GNOME. This command doesn’t work if you are using Ubuntu 12.04 or 12.10