Useful Terminal Commands

From Liki

Jump to: navigation, search

A list of useful *nix terminal commands and their functions:

Contents

Getting help

In almost all cases, typing

$ <command> --help

or

$ man <command>

will give help on the specifics for a particular command. If those fail, look on the liki, [Google] it, or ask somebody.

Directory Commands

commands for editing the directory structure:

command action
ls list directory contents
mkdir make a directory
rmdir remove an empty directory
rm remove a file
mv move a file
cp copy a file

Warning rm, mv, and cp are potentially destructive (whoops, there goes my research directory... etc.). To avoid doing something you'll regret later, it's wise to place something like

alias rm='rm -iv'
alias cp='cp -iv'
alias mv='mv -iv'

in your ~/.bashrc file (try nano ~/.bashrc). This makes the commands interactive by default and prints messages showing what files are being moved, deleted, etc.


Viewing and Editing Files

command action
cat print a file to the terminal
less allow scrolling through large program output (paginate)
nano simple text editor. Helpful shortcuts are listed at the bottom of the screen.
emacs complicated text editor. The shortcuts are in your head, but you can write your own.
vi another complicated text editor. Whatever works for you.

Searching Commands

command action
find search for a file (slow, but lots of features).
locate search for a file in a pre-compiled index (fast).
grep search a file (or stdin) for matching regular expressions.

Currently Uncategorized

command action
pwd print working directory.
ssh Secure SHell. Log in to remote computers.
scp Secure CoPy. Copy files to/from remote computers.
paste merge files by row paste,join, sort article
join intelligently merge files by row paste,join,sort article
sort sort files by row paste,join,sort article
uniq remove duplicate lines
cut select particular columns from a file
awk record editor for flat-text databases, general text processing.
sed stream editor, search-replace, etc.
find search for files
lsof list open files
ps show current processes


sms lucu sms lucu gokil sms cinta romantis sms selamat malam sms selamat malam romantis sms ungkapan cinta sms ungkapan rasa cinta sms selamat malam lucu sms selamat ulang tahun sms patah hati sms sakit hati kata cinta sedih kumpulan sms gokil waptrick trans 7 online rcti online sctv online mnc tv online indosiar online tv online indonesia berita unik berita terkini berita hari ini download software drama korea waptrick wapday wapdam contoh skripsi kata mutiara cinta tv online indonesia