0% found this document useful (0 votes)
24 views

Unix Handout 2017

The document lists useful UNIX commands and provides a brief description of each one. Some key commands include ls to list files, cd to change directories, cp to copy files, mv to move or rename files, mkdir to make new directories, and rm to remove or delete files. Other useful commands are less to view text files one page at a time, cat to output the entire contents of a file, and history to see previously entered commands.

Uploaded by

boxerito
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Unix Handout 2017

The document lists useful UNIX commands and provides a brief description of each one. Some key commands include ls to list files, cd to change directories, cp to copy files, mv to move or rename files, mkdir to make new directories, and rm to remove or delete files. Other useful commands are less to view text files one page at a time, cat to output the entire contents of a file, and history to see previously entered commands.

Uploaded by

boxerito
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Useful UNIX Commands

command description
ls lists the files in the working directory
ls blah lists the files in directory blah
cd blah changes to a new directory (blah)
pwd show name of present working directory (where am I?)
cp file1 file2 copy files (file2 = copy of file1)
cp file dir copy files into a destination directory
cp -r dir1 dir2 copy directory & sub-directories (dir2 = copy of dir1)
mv blah1 blah2 move (or rename) files or directories (blah2 = new name)
mkdir blah make a new (empty) directory
rm blah removes (deletes) file(s). Caution! There is no “undelete”
rmdir blah removes (deletes) an empty directory
less blah show contents of a text file - one screen at a time (type “q” to exit)
cat blah show contents of a text file - all at once
history see a list of previous commands (can rerun one with !N - e.g. !55)
rm -rf DON’T DO IT! Removes LOTS of files...
command description
ls -la blah list files (+hidden ones) with extra info
chmod flags blah changes permissions for files/directories
nano blah simple text-only editor (for file blah)
emacs blah more powerful/complicated, text-only editor (for file blah)
control c kill current running job and give back a prompt
command & run this command in background (gives new prompt)
control z suspend current stop and give back a prompt (job not killed)
bg after control z, will make last job run in background (like &)
tab key fill in end of filename (press twice for all possibilities)
up/down arrow keys scroll through history of commands
fsl start the main FSL GUI (can start all other GUIs from this)
fsleyes imagefile view 3D or 4D images (specifying imagefile is optional)
diff file1 file2 show differences between the two text files
wc blah character/word/line count of file blah (not a water closet)

You might also like