mkdir letters - (make directory), create a new directory named letters.
ls -al
mv dict letters - (move), move the dict into the directory letters.
ls -al letters/dict
mv dict* letters - here the character * matches any sequence of characters, including the null string. Thus files starting with dict would all be moved into letters.
cd letters - (chhange directory), work inside the directory letters.
ls -al dict
cd - to go back to our home directory.
ls -al - check what our home directory contains.
mkdir cprogs; mv *.c cprogs; ls -al cprogs/ letters/
pwd cd letters pwd rm * - removes all files in the current directory
cd .. - changes the current directory to the parent of the current one.
rmdir letters - (remove directory), to remove a directory we first remove all the file in it, then remove the directory.
man - manual/help, to investigate other flags to the command you are interested in type:
man commandname man ls - to investigate other flags, such as ``which flags will display file size and ownership?''
To quit man simply type the letter q.
ls -l filename - will list the long directory list entry (which includes owner and permission bits) and the group of a file. The output looks something like:
permission owner group filename
-rw-r----- 1 ozdogan ozdogan 65538 Feb 6 01:44 commands.html
The Permission Bits;
The first position (which is not set) specifies what type of file this is. If it were set, it would probably be a d (for directory) or l (for link).
The next nine positions are divided into three sets of binary numbers and determine permissions for three different sets of people.
u g o
421 421 421
rw- r-- ---
6 4 0
The file has "mode" 640.
The first bits, set to "r + w" (4+2=6) in our example, specify the permissions for the user who owns the files (u).
The user who owns the file can read or write (which includes delete) the file.
The next trio of bits, set to "r" (4) in our example, specify access to the file for other users in the same group (g) as the group of the file.
In this case the group is ug - all members of the ug group can read the file (print it out, copy it, or display it using more).
Finally, all other users (o) are given no access to the file.
The one form of access which no one is given, even the owner, is "x" (for execute).
This is because the file is not a program to be executed.
It is probably a text file which would have no meaning to the computer. The x would appear in the third position if it was an executable file.
If you wanted to make the file readable to all other users, you could type:
chmod 644 filename or chmod o+r filename
rm -i filename - would return a prompt asking if you are certain you want to delete that file.
du - display disk usage of the current directory and its subdirectories.
du -s - display only total disk usage.
du -s -k - some versions of UNIX, such as Solaris, need -k to report kilobytes.
df - to examine what disks and partitions exist and are mounted.
ps ux - to list your own processes.
top - an interactive command that displays and periodically updates the top cpu processes, ranked by raw cpu percentage. To quit top simply type the letter q.