- Home
- IT Tips And Tricks
- Unix Commands
Unix Commands
- By Samee Jhor
- Published 03/24/2007
- Linux , IT Tips And Tricks
- Unrated
Samee Jhor
View all articles by Samee Jhor
This is for the most part just some basic commands for moving through the
file system, and some file modification commands. The command is show on
the left with a colon after it, then a description and example usage(for
some of the more "complicated" commands).
NOTE: Some DOS commands have an equivalent for deleting/modifying
directories, most UNIX commands on the other hand simply use a flag or
option. Most programs accept options by typing "programname -options"
Many commands use the "-r" or "-R" option to delete directories or copy
them. This -R/-r means recursive, try dictionary.com for that one.
Second NOTE: UNIX commands are CASE sensitive, meaning "ls" is not the
same thing as "lS". Meaning when you type a command, type it as you see
it, without the quotes.
ls: Show files in directory, the equivalent of the ms-dos "dir"
command.
cd: Change directory. Same as the ms-dos "cd" command, for example:
"cd /xspace" will move you into the /xspace directory.
mv: Move, move directories or files, also the equivalent of the
rename command in DOS. For example "mv blah .." will move blah
one directory up. Or "mv blah black" will rename blah as black.
rm: Remark, or also known as remove/delete, the equivalent of the
dos del/deltree command. To delete a directory, use the -R flag.
"rm blah" would delete the file blah, to delete a directory, "rm
-r somedir" will recursively delete the directory and all it
contents.
cp: Copy, to copy files/directories. "cp blah blah1" would make a
copy of the file blah with the name of blah1. "cp -r blah blah1"
would be if blah was a directory. Again notice the -r option for
directories. -r in these commands means "recursive" look it up.
cat: concatenate or print files. cat will basically print the
contents of a file, whether it is binary or text. Shows the data
in the file, "cat blah" would show me the contents of blah, if it
were a program, I would most likely see lots of extended ASCII
chars and hear lots of beeps.
man: Manual page, most decent programs/commands will have a man page
type "man command" to view the manual page for that command.
Linux tends to have Poor, spotty, inconsistent man pages. OpenBSD
tends to have the best.(I am a OpenBSD user so I am biased).
du: Shows file size, on OpenBSD at least, du -k will show the amount
of kilobytes the file uses.

