|
UNIX
find . -perm 222 find . -perm /g+w,o+w find ~ -name "tutonics" //home directory find . -name myFile.txt 2>/dev/null //no error displayed find ~ -iname tutonicstuff.txt //case insensitive find . -mindepth 2 -name ".txt" find . -maxdepth 1 -name ".txt" find -L ~ -name ".txt" //search inside symbolic links find . -size -50k find . -size +100M find . -amin -30 //search for files accessed in the last 30 minutes find . -cmin -30 //change time find . -mmin -30 //modified time find . -atime 0 //accessed last 24 hours find . -atime 2 //accessed last 48 to 72 hours find . -daystart -mtime 0 //accessed beginning 12am find . -user tutonics -name "file.txt" find . -group luis -name "file.txt" find . -nouser -nogroup // no user or group find . -name ".log" -print0 //no newline for results find . -name ".txt" -printf "%M %f \t %s bytes \t%y %a, %t\n" //-rw-rw-r-- HXEDDIBG236.txt 1382 bytes f Sat Aug 2 00:45:38.0721792241 2014, Mon Mar 31 11:11:34.0813965629 2014 find . -name "oldStuff.txt" -delete find . -name ".txt" -exec ls -la {} + //execute in the current directory more efficient to use + instead of \; or ";" find . -name ".txt" -execdir ls -la {} + //execute in the directory where the match file resides find . -name ".txt" -ok rm {} \; //prompt for continuation find . -name ".txt" -okdir rm {} \; find . \( -name web -prune \) , \( -name bin -prune \) -o \( -name ".txt" \) //disregard somedir and bin man ls info ls less config.xml \\ /search(forward) ?search(backward) n(next) q(quit) rm -ir dirname \\ prompt before deletion ls -la > out.txt \\overwrite ls -la >> out.txt \\append find /etc/ -name ".conf" 2>error.txt 1>result.txt \\ place error on another file find /etc/ -name ".conf" &> output.txt \\put all to one file &1 \\standard ouput &2 \\standard error &0 \\standard input cat file.txt | wc -l \\ count the number of lines some_command | tee save.txt | grep "something" | wc -l \\save to text file while greping ls -al \\show hidden files ps aux \\show process ps -U lchua u \\ show user process ps axo user,vsize,rss,pmem,cp \\show the user, virtual memory size,resident physical memory size, overall memory usage and cpu usage ps axo comm,args,vsize \\display program name, command line args, and virtual memory size ps axo comm,args,vsize,rss --sort rss \\sort http://www.tutonics.com/2012/06/using-ps-to-list-processes-advanced.html top \\monitor process sudo iotop \\disk swap sudo nethogs \\net usage sftp user@192.168.0.7 lcd \\local change path for sftp lpwd \\local pwd get -p file_name get -r dir_name put -p file_name put -r dir_name scp myfile root@192.168.0.7:/root/stuff/new_file_name scp tutonics@192.168.0.7:/home/tutonics/stuff/myfile ./ scp tutonics@192.168.0.7:/home/tutonics/stuff/myfile root@192.168.0.110:/root/stuff/new_file_name crw--w---- \\character drive drwxr-xr-T \\only root or the file's owner has permission to change files in that directory which cat \\show the directory of the os command top -p <pid> \\linux prstat \\solaris equivalent of top ps -p 20159,11292,28883,7735,7738 -o pid,pcpu,pmem \\solaris ulimit -v <kb> umask 022 /proc/ <pid>/limits /proc/meminfo /proc/cpuinfo /usr/sbin/psrinfo \\solaris equivalent of cpuinfo /etc/release \\release /usr/sbin \\hidden shells taskset -c 3,4 <sh> //To bind existing process with PID 13545 to processor 3,4 pbind -b 2 13545 //To bind existing process with PID 13545 to processor 2 nice -n 10 <sh>
|