Академический Документы
Профессиональный Документы
Культура Документы
=============================================================================
"cd [DIRECTORY]" Change the current directory to the one listed. Use "cd .." To
go up one directory.
"clear" Clears the screen of the terminal.
"ls" Lists the contents of a directory. Add "-i" for inodes, "-a" for all files,
"-l" for the long list format, "-h" for Kil/Meg/Gig printouts.
"date" shows the date and time from the system clock.
"cal" Shows the current month calendar. Use "cal [YEAR / 2012]" to print out the
entire year.
"cat" Used to output a text files contents to the terminal.
" >> " Append that after a command to dump the output to a text file. For
instance say I run "cat [TEXT FILE] >> /root/dump1" that will dump the
contents of whatever comes out of cat into a text or binary file in the root
directory called dump1. Very useful for logs and stuff.
"| grep "PATTERN"" Takes a line from a file and prints it out when it matches th
e pattern. I can also just use regular grep on a file. "a" will treat binary fil
es like text files. "-d recurse" Will search through the files inside a director
y.
Add "-c" to count the number of matching lines in the file.
Add "-o" to print only the matching part of the pattern.
To dump grep output into a text file use "grep > [TEXT FILE]" trying now. That
works.
"history -c" Appears to clear the bash history.
"cut" Is some program useful with grep. I'm not good with it.
But cut can be used to output the pipe to a text file like this:
"cut -f1 > [text file]" as a very basic example.
"gpg" the encryption suite for Unix. I can encrypt the
file using "gpg -e [filename]" and give a passphrase. Not sure how secure it
is though. Decryption is "gpg -d --output [output_filename] [gpg file]" and
giving the correct passphrase. "-o" is a shortcut for the output.
"--cipher-algo AES256" looks good for me. List ciphers with "gpg --version".
Now gpg wants me to specify a user id to encrypt stuff when I use "-e".
Figured it out. Use "-c" instead of "-e" to encrypt without user id.
"du" Estimates file space usage. "-a" for all, "-L" dereference links, "-h" huma
n readable, "--max-depth=[NUMBER]" try 0, "-s" summary.
"df" Report file system disk space usage. Use "-h" for Kil Meg and Gig.
"dir" List directory contents. "-a" Shows all files. "-l" for long format, "-h"
for human readable, "-i" for inodes of each file.
"adduser" Adds a user to the system. See the manual file for this command.
"rm [FILENAME]" Simple file deletion.
"shred -u [FILENAME]" Use this to securely shred a file. "-z" adds zeros to hide
mounted on the filesystem. Use "ls /dev |grep sd" to show basic connections.
"mount -t vfat [DEVICE] [MOUNT_POINT]" Mounts the floppy drive that I use.
"updatedb" I guess it updates the index file for the locate function.
"sqlite" Opens up an SQLite editor. It's not the latest version though.
"sqlite3 [database]" Opens up an SQLite editor, its version 3.5.9 I think.
"vdir" Lists directory contents. Add "-a" for all files. Add "-d" for directory
entries instead of contents. "-g" long form ("-l") but without showing owner. "h" for human readable.
"info coreutils 'vdir invocation'"
"gdbm" The GNU database manager. Has dbm and ndbm compatibility. Open files with
"[FILE] [READER/WRITER] dbm" Looks like an SQL type thing.
"gdb" is the GNU Debugger. I guess it debugs executables.
"bc" Looks like some kind of weird calculator program. Pretty technical too. Use
"quit" to exit the shell prompt for bc.
"gzip" Compress or uncompress files. "gzip -d [FILENAME]" to bring the file back
. It's better to use tar for multiple files.
"tar" Used to extract files or create tar archives. "tar -cf [NEWTARARCHIVE.tar]
[FILE1] [FILE2]" creates one. To list use "tar -tvf [TAR]". Extract with x.
"tar -xvz" Will extract most gzipped files.
"tar -xvjf [FILENAME]" To extract bz2 files use.
"ssh" Open an SSH client.