| Thanks to antville.org |
|
Monday, 11. January 2010
Counting file types
shantanuo
18:43h
cat myawk.sh
#!/bin/sh # list the type of files with count find ${*-.} -type f -print | xargs file | awk '{ $1=NULL; t[$0]++; } END { for (i in t) printf("%d\t%s\n", t[i], i); }' | sort -nr ... Link (0 comments) ... Comment Tuesday, 29. December 2009
show processlist
shantanuo
09:50h
ps aux
When you run ps you will only get the first 40 or so characters displayed. In order to view the entire string, use ... ps auxgww ... Link (0 comments) ... Comment Wednesday, 23. December 2009
Which Linux?
shantanuo
14:22h
If you're a Linux expert, Fedora is for you. If you just want a good, general-purpose desktop for home or work, then openSUSE is your best pick. And if you're new to Linux, and your computer gets along well with Ubuntu, Ubuntu is still a good choice.
Knoppix if you want to use Linux off a live CD and puppy linux is for everyone!! ... Link (0 comments) ... Comment
Killing processes
shantanuo
14:06h
You can enter the "kill" command in a terminal if a process hangs.
kill ID kill -9 ID pkill firefox You can switch to a virtual terminal using Ctrl + Alt + F1 if the user interface does not allow you to start the terminal. This should hopefully restore some sanity to your computer and you can switch back to the GUI using Ctrl + Alt + F7 ... Link (0 comments) ... Comment Friday, 18. December 2009
vim syntax
shantanuo
17:37h
behave mswin - Copy and Paste with Ctrl+C CtrlV
set laststatus=2 - grey status bar at the bottom syntax on - syntax highlighting set autoindent - auto indenting set number - line numbers set showcmd - show command in status line set showmatch - show matching brackets set ignorecase - do case insensitive matching set hlsearch - highlight what you search for ... Link (0 comments) ... Comment
Easy SSH
shantanuo
14:43h
HashKnownHosts no
Add the above line in your ssh_config file that can be found here.... /etc/ssh/ssh_config ... Link (0 comments) ... Comment Tuesday, 1. December 2009
Inernal File Separator
shantanuo
17:07h
The safe way to change IFS in a 'while read' loop is:
while IFS=\| read a b c do : whatever done ... Link (0 comments) ... Comment Saturday, 21. November 2009
Overwriting files
shantanuo
17:15h
output redirection using n> usually overwrites existing files. You can control this with the noclobber option of the set builtin. If it has been set, you can override it using n>|
$ set -o noclobber $ ls x* z* >stdout.txt 2>stderr.txt -bash: stdout.txt: cannot overwrite existing file $ ls x* z* >|stdout.txt 2>|stderr.txt $ set +o noclobber ... Link (0 comments) ... Comment Thursday, 19. November 2009
send messages across network
shantanuo
18:34h
The following command can be used to send messages to remote servers.
ssh -X root@123.123.123.123 'DISPLAY=:0 notify-send "TEST MESSAGE."' The command that actually sends the message is... notify-send "hi vandana" ... Link (0 comments) ... Comment Sunday, 18. October 2009
power of wget
shantanuo
09:46h
wget is really a very powerful utility. Here is an example.
wget -mk oksoft.antville.org I can download all the pages linked from my blog. And it is so easy! -m (--mirror) Turn on options suitable for mirroring. This option turns on recursion and time-stamping, sets infinite recursion depth and keeps FTP directory list‐ings. It is currently equivalent to -r -N -l inf --no-remove-listing. -k (--convert-links) After the download is complete, convert the links in the document to make them suitable for local viewing. ... Link (0 comments) ... Comment ... Next page
|
Online for 2726 days
Last modified: 2010.01.11, 18:43 Status
Youre not logged in ... Login
Menu
Search
Calendar
Recent updates
Counting file types cat
myawk.sh
#!/bin/sh
# list the type of files with count
find...
by shantanuo (2010.01.11, 18:43)
show processlist ps aux
When you run ps you will only get the first 40...
by shantanuo (2009.12.29, 09:50)
Which Linux? If you're a
Linux expert, Fedora is for you. If you just want...
by shantanuo (2009.12.23, 14:22)
Killing processes You can enter
the "kill" command in a terminal if a process hangs....
by shantanuo (2009.12.23, 14:06)
vim syntax behave mswin -
Copy and Paste with Ctrl+C CtrlV
set laststatus=2 - grey...
by shantanuo (2009.12.18, 17:37)
sed can make you sad!
Changing the -e to -i in the following can be...
by shantanuo (2009.12.18, 17:09)
Easy SSH HashKnownHosts no
Add the above line in your ssh_config file that can be...
by shantanuo (2009.12.18, 14:43)
Inernal File Separator The safe
way to change IFS in a 'while read' loop is:...
by shantanuo (2009.12.01, 17:07)
Overwriting files output redirection using
n> usually overwrites existing files. You can control this with...
by shantanuo (2009.11.21, 17:15)
send messages across network The
following command can be used to send messages to remote...
by shantanuo (2009.11.19, 18:34)
power of wget wget is
really a very powerful utility. Here is an example.
wget...
by shantanuo (2009.10.18, 09:46)
Silence of the Foxes This
simple Firefox tool lets you create custom Firefox installers which...
by shantanuo (2009.09.13, 19:30)
Wow 15 years IT experience
and you don't know the difference between a bit and...
by lolquestionmark (2009.09.01, 18:29)
Zoom in Ubuntu I can
change the tabs in firefox by using Alt + 2...
by shantanuo (2009.08.23, 07:49)
Google Calculator >> 24685316 kb
in MB
shows the wrong results:
24 685 316 kilobits...
by shantanuo (2009.08.16, 13:04)
Old date in Shell If
you need to know the 3 days old date, it...
by shantanuo (2009.08.11, 12:50)
Finding in Linux I was
looking for the file translate.html from my backup drives, e:...
by shantanuo (2009.08.10, 12:56)
Number all lines in a
file perl -pe '$_ = "$. $_"'
ā-pā causes Perl...
by shantanuo (2009.08.09, 12:16)
Ubuntu Root The root account
is disabled by default on Ubuntu installations, mainly to prevent...
by shantanuo (2009.08.09, 11:35)
Starting Ubuntu You can make
Ubuntu remember the applications you had open when you last...
by shantanuo (2009.08.09, 11:31)
Export to Excel Just create
a regular .PHP file, where you output your data in...
by shantanuo (2009.08.07, 13:27)
Gmail in Firefox You can
set Gmail as Default Email Client in Firefox
* go...
by shantanuo (2009.07.07, 20:07)
tmpdir in MySQL In MySQL,
the tmpdir path is mainly used for disk-based sorts (if...
by shantanuo (2009.06.20, 07:22)
Install SQLite $ # As
of March 2009, the latest version was 3.6.11.
$ wget...
by shantanuo (2009.05.13, 19:24)
Using binlogs to update table
It is very interesting to know about how to extract...
by shantanuo (2009.05.11, 21:43)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||