CD - Change Directory - NOTE: you must have a space after cd , unlike in DOS.
cd <directory name> Change to directory whose name is <directory name>, assuming that
the named directory is within the current directory or that you provide the entire pathname of the directory.
cd Change to the home directory.
cd .. move up one directory level.|
MKDIR - Create a Directory
mkdir dddd.dd.dd will create the directory dddd.dd.dd in the current directory.
RMDIR - Remove an Empty Directory
rmdir dddd.dd.dd will remove the directory dddd.dd.dd if it exists in the current directory and is empty. (see rm -ir dddd.dd.dd to remove the directory and everything in it)
PWD - Display the Name of the Current/Working Directory
If you are in /etc/skel,
pwd will display /etc/skel - what is displayed is the actual directory name (fully resolved), not a symbolic link
Each file has an assigned set of mode bits, ownership (user and group), and flags. To view these assignments, run the command ls -lo and get a result like this (only one file is shown)|
-rw-r--r-- 1 root wheel sappnd,arch 2188 Sep 17 2003 junk.test
The first grouping of characters represent the modes assigned to the file.
root is the file's owner
wheel is the file's group
sappnd,arch are the file's flags
chmod changes the file's mode
chown changes the file's owner
chgrp changes the file's group
chflags changes the file's flags
CHKDUPEXE - Find Duplicate Executables
CKSUM - Checksum and Count the Bytes in a File
cksum fffff displays the checksum, size (in bytes) and the file name of file fffff
for example, cksum vmlinuz displays 1266362081 461067 vmlinuz
CMP - Compare Two Files of Any Type
CP - Copy a File
cp <source file> <target file> Copies source file to target
file of the same or another subdirectory and names it <target file>
cp <source file> <target directory> Copies source file to another file of the same name in the subdirectory of <target directory>
cp ~user_name/file . Ccopies file from the main directory of the user, user_name, to the directory in which you are crrently located.
cp -r <source directory> <target directory> Copies
<source directory >, and everything in it, to <target directory>
-b Make backups of files that are about to be overwritten or removed. (add ~ to end of file name)
-i Interactive - asks whether to overwrite each existing destination file
-v Verbose - shows the name of each file before copying it
DIFF - Find Differences Between Two Files
DIFF3 - Find Differences Between Three Files
FIND - Find a File
find <start dir> -name <pattern> find / -name gz* will locate all files starting in the
root directory with a name matching "gz*". NOTE: THIS WILL ALSO SEARCH ALL ATTACHED DISKS INCLUDING CD-ROMs IF MOUNTED -
Try to start with a lower level directory. (the -mount switch will also prevent this)
find / -mtime -1 \! -type d will list all files (starting with the root directory) changed in the
last 24 hours. /mtime -1 specifies the 24 hour filter. \! -type d excludes directories from file list.
find / -xdev -name X*.h finds all files matching X*.h (* is a wildcard).
the -xdev switch excludes any other type of file systems from
being searched (the root is an ext2 system, /dosc is a dos system).
LS - List File Names
ls Provides a list of files and directories in the current subdirectory
ls -a Includes 'hidden' files in this list (to 'hide' a file, just use the period (.) as the first character of the file name)
ls -l l = long - includes file sizes and ownerships in this list
ls <dirname> Llist files and directories within the directory <dirname>, assuming the directory <dirname> is within the current directory, otherwise you must specify the directory's complete pathname
ls | less allows you to page through a long list of files ('q' quits the paging)
MV - Move A File
mv <source name> <directory name> If <directory name> exists, move file or directory <source name> into directory <directory name>
mv <source file name> <target file name> Similar to copy except that the source file is deleted. Note that the name may be changed during the move
-b Make backups of files that are about to be removed (add ~ to end file file name)
-i Interactive mode - asks whether to overwrite a destination file that already exists.
-v Verbose - Show the name of each file before moving it
Note: This command will not work on another persons account!!
RM - Delete/Erase a File
rm -i <filename> Removes the file whose name is <filename>
rm * Removes all files in the current subdirectory
rm -ir <dirname> Removes a directory and everything in it. DO NOT OMIT THE 'i'(interactive option) or you may lose more than you want
DSPLIT - Split a Large File into Pieces
SPLIT - Split a File Into Pieces
TAR - Tape ARchiver; manipulate "tar" archive files
TOUCH - Change a File's timestamps
touch demo1.cpp updates the access and modification times of demo1.cpp to the current time
Options include :
-a - Changes only the access time.
-m - Changes only the modification time.
FIZ - Analyze a Damaged ZOO Archive for Data Recovery
CJPEG - Compress an image file to a JPEG file|
DJPEG - Decompress a JPEG File to an Image File
RDJPGCOM - Display Text Comments from a JPEG File