中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

Unix/Linux File and Directory Management Commands

apropos: Search the whatis database for files containing specific strings.

bdflush: Kernel daemon that saves dirty buffers in memory to the disk.

cd: Change the current directory. With no arguments "cd" changes to the users home directory.

chmod: chmod <specification> <filename> - Effect: Change the file permissions.

chown: chown <owner1> <filename> Effect: Change ownership of a file to owner1.

chgrp: chgrp <group1> <filename> Effect: Change group.

cksum: Perform a checksum and count bytes in a file.

cp: cp <source> <destination> Copy a file from one location to another.

dd: Convert and copy a file formatting according to the options. Disk or data duplication.

dir: List directory contents.

dircolors: Set colors up for ls.

file: Determines file type. Also can tell type of library (a.out or ELF).

find: Ex: find $Home –name readme Print search for readme starting at home and output full path.

install: Copy multiple files and set attributes.

ln: Make links between files.

locate: File locating program that uses the slocate database.

losetup: Loopback device setup.

ls: List files. Option -a, lists all.

mkdir: Make a directory.

mknod: Make a block or character special file.

mktemp: Make temporary filename.

mv: Move or rename a file. Syntax: mv <source> <destination> Ex: mv filename directoryname/newfilename

pathchk: Check whether filenames are valid or portable.

pwd: Print or list the working directory with full path (present working directory).

rm: Ex: "rm .*" - Effect: Delete system files (Remove files) –i is interactive option.

rmdir: rmdir <directory> - Remove a directory. The directory must be empty.

slocate: Provides a secure way to index files and search for them. It builds a database of files on the system.

stat(1u): Used to print out inode information on a file.

sum: Checksum and count the blocks in a file.

test: Check file types and compare values.

touch: Change file timestamps to the current time. Make the file if it doesn't exist.

update: Kernel daemon to flush dirty buffers back to disk.

vdir: List directory contents.

whatis: Search the whatis database for complete words.

wheris: Locate the binary, source and man page files for a command.

which: Show full path of commands where given commands reside.

File viewing and editing Commands

ed: Editor

emacs: Full screen editor.

gitview: A hexadecimal or ASC file viewer.

head: head linuxdoc.txt - Look at the first 10 lines of linuxdoc.txt.

jed: Editor

joe: Editor

less: q-mandatory to exit, Used to view files.

more: b-back q-quit h-help, Used to view files.

pico: Simple text editor.

tail: tail linuxdoc.txt - Look at the last 10 lines of linuxdoc.txt.

vi: Editor with a command mode and text mode. Starts in command mode.

File Compression, Backing up and Restoring Commands

ar: Create modify and extract from archives.

bunzip2: File decompression program.

bzcat: Decompress files to stdout.

bzip2: File compression program.

bzip2recover: Recovers data from damaged bzip2 files.

compress: Compress data.

dump: Reads the filesystem directly.

gunzip: unzip <file> - unzip a gz file.

gzexe: Compress executable files in place.

gzip: gzip <file> - zip a file to a gz file.

uncompress: Expand data.

unzip: unzip <file> - unzip a zip file. Files ending in ".gz" or ".zip" are compressed.

zcat: Used to restore compressed files.

zcmp: Compare compressed files.

zdiff: Compare compressed files.

zforce: Force a .gz extension on all gzip files.

zgrep: Search possibly compressed files for a regular expression.

zmore: File filter for crt viewing of compressed text.

znew: Recompress .z files to .gz files.

zip: zip <file> - make a zip file.

Unix/Linux Printing Commands

banner: Print a large banner on printer.

lpr: Print, submits a job to the printer.

Ex: lpr -Pdest filename.

lpc: Lets you check the status of the printer and set its state.

lpq: Shows the contents of a spool directory for a given printer.

lprm: Removes a job from the printer queue.

gs: Ghostscript - A PostScript interpreter.

pr: Print a file. Ex: pr filename |pg.

tunelp: Set various parameters for the lp device.