Some basic Linux commands

Following commands are often used when we use Unix/Linux systems

If you would like to learn how to use a command, use the "man" command before googling;-), for e.g.

man [command]

ls

List directory contents

ls [file]

pwd

Return working directory name

pwd

mkdir

Make directories

mkdir [dir1] [dir2] ...

cd

Change directory

cd [dir]

Default (no argument): change directory to home (equivalent to cd ~ or cd $HOME)

cp

Copy files

cp [file1] [file2]

mv

Move files

mv [file1] [file2]
mv [file] [dir]
mv [file1] [file2] ... [dir]

rm

Remove directory entries

rm [file1] [file2] ...

rmdir

Remove directories

rmdir [directory]

tar

Manipulate tape archives Extract files from an archive

tar xf [tar file]

Extract files from a compressed (gzip'd) archive

tar zxf [tgz (or tar.gz) file]

or

gzip -c [tgz (or tar.gz) file] | tar xvf -

Create an archive

tar cf [tar file] [file1] [file2] ...

Create a compressed (gzip'd) archive

tar cf - [file1] [file2] ... | gzip -c > [tar.gz (tgz) file]

or

tar zcf [tgz (tar.gz) file] [file1] [file2] ...

scp

Secure copy (remote file copy program)

Copy files to a remote host

scp [file1] [file2] ... [userID]@[remote host]:[remote directory]

Copy files in a remote host to a local host

scp [userID]@[remote host]:[remote directory]/[file] [local directory]

vi

A text editor (usages)

emacs

A text editor

Miscellaneous

Force to terminate a command

Ctrl+c

Current directory

.

Upper directory

..

Home directory

~

or

$HOME
トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS