Just type in startx and the GUI will boot up.
2.How To Split Large Files in Unix http://unix-simple.blogspot.com/2011/06/how-to-split-large-files-in-unix.html
split -1000 my_list my_list
then the output files would have been my_listaa, mylistab, etc.
3.How To Run A Unix Command In A Directory With Too Many Files
http://unix-simple.blogspot.com/2011/05/how-to-run-unix-command-in-directory.html
He was trying to run grep pattern * > /tmp/tmpfile in a directory containing 240,695 files and he got the error "ksh: /bin/grep: arg list too long".
He thought the limitation was in grep and so asked me to provide him with the equivalent awk script. I told him that it was not agrep problem. The issue is with too many arguments on the command line - so the problem would happen with awk also.
You simply cannot put 240,695 arguments on a command line.
The solution is to use a for loop, so you are actually running the command 240,695 times with only one argument:
for i in *
do
grep pattern $i >> /tmp/tmpfile
done
With the xargs example, the command would be:
find . -print | xargs grep pattern >/tmp/tmpfile
The print returns the log commands, and xargs takes the standard input and uses it (piece by piece) as the argument.
More compact and elegant!
4. Network tracking
mtr, better than traceroute and ping combined
/usr/sbin/mtr google.com5.
http://www.commandlinefu.com/commands/browse
http://en.wikipedia.org/wiki/List_of_Unix_programs
6.How To Find Large Files and Directories in Unix
The find command accepts a size parameter, and you can specify the limits for file sizes in your command line.
This example finds all the files under /etc directory which are larger than 100k:
This example finds all the files under /etc directory which are larger than 100k:
root@ubuntu# find /etc -size +100k /etc/ssh/moduli /etc/ssl/certs/ca-certificates.crt /etc/bash_completion
Find files within specified size limits
The real beauty of using find command is that you can specify both the lower and the upper file size limit in one command line. Working off the previous example, we can limit the search to find only files with the size of 100k-150k, quite easily:root@ubuntu# find /etc -size +100k -size -150k /etc/ssl/certs/ca-certificates.crt /etc/bash_completionShow directory sizes using du
du command takes a little while to run, depending on what directory you pass it as a parameter, but then prints you a list of all the subdirectories along with their sizes. Most common usage is shown below, -s parameter makes the command report a summary of disk usage stats for only the specified directories matching the /usr/* mask (and not their subdirectories), and -k specifies that we want to see the results in kilobytes:greys@ubuntu$ du -sk /usr/* 4 /usr/X11R6 97664 /usr/bin 24 /usr/games 11628 /usr/include 167812 /usr/lib 0 /usr/lib64 96 /usr/local 25076 /usr/sbin 201500 /usr/share 4 /usr/srcIn most Linux systems, this command had been updated to support a -h parameter, which makes sizes even easier to interpret:greys@ubuntu$ du -sh /usr/* 4.0K /usr/X11R6 96M /usr/bin 24K /usr/games 12M /usr/include 164M /usr/lib 0 /usr/lib64 96K /usr/local 25M /usr/sbin 197M /usr/share 4.0K /usr/srcCommand to find out command location:which:Usage:~% which find/usr/bin/find
No comments:
Post a Comment