Basic UNIX Commands
All commands must be typed in lowercase.
Operation command
copy cp
move mv
rename mv
directory list ls
change directories cd
create directory mkdir
list a file more, cat
show curent directory pwd
change file permissions chmod
change password passwd
logging off exit
The commands and examples
ls (list). Does a directory listing.
ls lists a directory in columns
ls -l gives a fuller listing including file permissions, size, date created
ls -al similar to the above but includes "dot" files
cd (change directory).
cd return to the home directory
cd .. move up one directory level
cd ../.. move up two directory levels
cd subdirectory move to subdirectory
cp (copy).
cp file1 file2 copy file1 to file2
cp file1 subdirectory copy file1 to subdirectory
cp file1 file2 directory copy file1 and file2 to directory
mv (move). Moves or renames one or more files.
mv file1 newname renames file1
mv directory newname renames directory
mv directory existing-directory moves directory to a subdirectory of target
mv file1 file2 directory move files to directory
mkdir (make directory).
mkdir subdirectory creates a subdirectory in the current directory
more. Lists files one screen at a time. Pressing the space bar dislays the
next screenful and pressing q or ctrl-c cancels the listing.
more filename
cat (catenate). Display, combine or append files.
cat file1 display file1
cat file1 file2 > file1and2 combines file1 and file2
cat file1 >> file2 append file1 to file2
chmod (change mode). Change file permissions.
chmod u+w file1 add write permission for the user to file1
chmod g+x file1 add execute permission for the group to file1
chmod o-r file1 remove read permission for the world from file1
man (manual). Display reference manual documentation for the specified command.
man chmod display manual information for the chmod command
man -K keyword shows all of the man pages that contain keyword
pwd (print working directory). The default setup on nun is to have the
system prompt display the current directory. This means that there isn't
much need to use the pwd command.
rm (remove). Deletes files. Never use rm * (it will delete all of your
files). rm filename will remove the specified file. There is no
undelete. Some files may be recoverable from backups.
rm filename deletes the file with the specified filename
rm -i filename deletes the file after prompting
rmdir (remove directory). Deletes empty directories.
passwd (password). Changes your password. We recommend password of two
three letter words connected with a punctuation symbol or a number.
passwd newpassword changes your password
exit Terminates a session.
|