Simple UNIX commands
Simple UNIX commands
- ls Outputs a list of files and directory names.
- cd Changes the current directory.
- cp Copies the specified files from one directory to another or to another file.
- mv Moves the specified files from one directory to another or to another file.
- rm Deletes the specified files.
- mkdir Creates a new directory.
- rmdir Removes an empty directory.
- exit Exits the current shell.
- more Displays the contents of a text file page by page on screen.
- man Dsiplays the on-line documentation (Manual pages) corresponding to a command.
- cat Concationation of files, or outputting the contents of a file.
- grep Searches within the specified files for a certain pattern.
- passwd Changes a user's password.
- ps Lists all running processes with their process ID.
- kill Sends a signal to the specified process ID.
- su Temporaily change the user ID, without having to repeat the login.
[Return to tutorial page] [Return to main page]
ls
Lists the files found in the file system.
ls [flags] filelist
[flags]
filelist - A space seperated list of files and directories to list
Suggested options
[Return to the index] [Return to tutorial page] [Return to main page]
cd
Changes the current working directory.
cd dirname
dirname - Changes to an optional directory name. If no directory is specified, the user is returned to his home directory.
[Return to the index] [Return to tutorial page] [Return to main page]
cp
Copies files. You may copy one file to another, or a list of files to a directory.
cp source-file dest-file
cp source-list dest-directory
source-file - The file to copy
dest-file - The destination filename. This maybe a directory name, in which case the source file name is appended to the directory
source-list - A space seperated list of files to copy
dest-directory - The destination directory
[Return to the index] [Return to tutorial page] [Return to main page]
mv
Renames a file or moves it to a new direcory, or both. mv also allows you to rename a directory.
mv [flags] file1 file2
mv [flags] dir1 dir2
mv [flags] filelist dir
flags
file1 - The source file name
file2 - The destination file name (new name)
dir1 - The source directory name
dir2 - The destination directory name (new name)
filelist - A space seperated list of files to move. Names are retained.
dir - The destination directory.
[Return to the index] [Return to tutorial page] [Return to main page]
rm
Removes files and intire directory structures from the file system.
rm [flags] filelist
flags
filelist - A space seperated list of files you want to delete. It may contain directory names as well.
[Return to the index] [Return to tutorial page] [Return to main page]
mkdir
Creates directories.
mkdir [flags] dirnames
flags
dirnames - The path of the directory to be created
[Return to the index][ [Return to tutorial page] [Return to main page]
rmdir
Removes directories.
rmdir [flags] dirlist
flags
dirlist - A space seperated list of directory names. Directories must be empty to be deleted
[Return to the index] [Return to tutorial page] [Return to main page]
exit
Exits from the current shell.
exit
[Return to the index] [Return to tutorial page] [Return to main page]
more
More is a general purpose pager. It is used to view text files that scrolls off the screen.
more [flags] filenames
flags
filelist - A space seperated list of file names.
[Return to the index] [Return to tutorial page] [Return to main page]
man
NOT YET DONE!!!
man
[Return to the index] [Return to tutorial page] [Return to main page]
cat
Concatenates files. This is sometimes used to display a file.
cat [flags] filelist
flags
filelist - A space seperated list of file names to be concatenated. If none is given then stdin is used.
[Return to the index] [Return to tutorial page] [Return to main page]
grep
NOT YET DONE!!!
grep
[Return to the index] [Return to tutorial page] [Return to main page]
passwd
Allows a user to change their passwd.
passwd username
username - Changes the passwd of the user username.
[Return to the index] [Return to tutorial page] [Return to main page]
ps
NOT YET DONE!!!
ps [flags]
[Return to the index] [Return to tutorial page] [Return to main page]
kill
Allows you to send a signal to a process that is currently running. Usually this command is used to cause the process to stop executing.
kill -signal pid
-signal The signal that is going to be sent.
pid The process ID of the process you want to send the signal to.
[Return to the index] [Return to tutorial page] [Return to main page]
su
NOT YET DONE!!!
su [flags]
[Return to the index] [Return to tutorial page] [Return to main page]
Page last updated by John-Lucas Brown 03-Apr-1997