
Terminal - Commands tagged shell - 68 results
This is sample output - yours may be different.
slocate httpd
slocate: warning: database /var/lib/slocate/slocate.db' is more than 8 days old
/usr/bin/vnc_inetd_httpd
/usr/sbin/httpd2
/usr/sbin/httpd2-prefork
/usr/sbin/httpd2-worker
/usr/include/apache2/httpd.h
/usr/include/apache2-worker/httpd.h
/usr/include/apache2-prefork/httpd.h
/usr/include/apache2-event/httpd.h
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/configs/lighttpd.conf
output truncated for better viewing.
After you install slocate ,the first thing you have to do with it to initialise the database by issuing a command " slocate -u" . And then onwards just give the filename or dirname as a argument to the slocate command will reveal the files/dirs location in the system along with path.Moreover over it's an securely way of looking into the file system.
This is sample output - yours may be different.
Use it like this below:
vnstat -u -i interface forces a database update for interface or creates the database if it doesn't exist. This is
usually the first command used after a fresh install.
vnstat -u -i interface --nick nick gives interface the nickname nick and that information will be later included
with queries.
vnstat -u -r --disable -i interface resets the internal counters of interface and disables it from being updated
before enabled again with the --enable parameter. This feature is especially useful for interfaces like ppp0 that
aren't always active.
And one of out put will be below,
sudo /usr/bin/vnstat -l
Monitoring ppp0... (press CTRL-C to stop)
rx: 0.00 kB/s 0 p/s tx: 0.00 kB/s 0 p/s^C
ppp0 / traffic statistics
rx | tx
--------------------------------------+----------------------------------------
bytes 0 kB | 0 kB
--------------------------------------+----------------------------------------
max 0.05 kB/s | 0.03 kB/s
average 0.01 kB/s | 0.00 kB/s
min 0.00 kB/s | 0.00 kB/s
--------------------------------------+----------------------------------------
packets 1 | 1
--------------------------------------+----------------------------------------
max 0 p/s | 0 p/s
average 0 p/s | 0 p/s
min 0 p/s | 0 p/s
--------------------------------------+----------------------------------------
time 17 seconds
It has got so many wonderful switch to get the exact data you need.
A wonderful command line utility to check the internet usage. It has got so many useful switch to display the data you want.Please visit the man page to get all the information.Get it from this website http://humdi.net/vnstat
This is sample output - yours may be different.
sudo /bin/netstat -tpee
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 localhost:16001 localhost:43797 ESTABLISHED root 13943 3244/esd
tcp 0 0 115.184.221.168:52327 ty-in-f113.goo:www-http ESTABLISHED bhaskar 115800 3993/firefox
tcp 0 0 115.184.221.168:47047 maa03s01-in-f1:www-http ESTABLISHED bhaskar 102184 4426/thunderbird-bi
tcp 0 0 115.184.221.168:35261 tx-in-f102.goo:www-http ESTABLISHED bhaskar 116478 3993/firefox
tcp 0 0 115.184.221.168:52328 ty-in-f113.goo:www-http ESTABLISHED bhaskar 115801 3993/firefox
tcp 0 0 115.184.221.168:50385 maa03s01-in-f19.g:https ESTABLISHED bhaskar 117306 3993/firefox
tcp 0 0 115.184.221.168:47965 tx-in-f102.google:https ESTABLISHED bhaskar 116487 3993/firefox
tcp 0 0 115.184.221.168:54017 maa03s01-in-f1:www-http ESTABLISHED bhaskar 115833 4426/thunderbird-bi
tcp 0 0 115.184.221.168:58635 tx-in-f102.google:https TIME_WAIT root 0 -
tcp 0 0 115.184.221.168:43084 maa03s01-in-f147.:https ESTABLISHED bhaskar 116498 3993/firefox
tcp 0 0 115.184.221.168:47979 tx-in-f102.google:https ESTABLISHED bhaskar 117112 3993/firefox
tcp 0 0 localhost:43797 localhost:16001 ESTABLISHED bhaskar 13942 3993/firefox
To get the connection information of protocol tcp and extended infortmation.
This is sample output - yours may be different.
dstat -afv
Terminal width too small, trimming output.
-------cpu0-usage--------------cpu1-usage------ --dsk/sda-- --net/ppp0- ---paging-- ---system-- ---procs--- ---paging-->
usr sys idl wai hiq siq:usr sys idl wai hiq siq| read writ| recv send| in out | int csw |run blk new| in out >
5 2 91 1 0 0: 5 1 93 0 0 0| 98k 37k| 0 0 | 296B 1713B| 662 1543 | 0 0 5| 296B 1713B>
2 0 98 0 0 0: 1 0 99 0 0 0| 0 0 | 583B 671B| 0 0 | 560 789 | 0 0 0| 0 0 >
0 1 99 0 0 0: 1 1 98 0 0 0| 0 52k| 254B 2522B| 0 0 | 918 916 | 0 0 0| 0 0 >
1 0 99 0 0 0: 39 0 61 0 0 0| 0 152k| 685B 104B| 0 0 | 786 593 | 0 0 0| 0 0 >
0 0 100 0 0 0: 1 0 99 0 0 0| 0 0 | 0 0 | 0 0 | 676 782 | 0 0 0| 0 0 >
0 0 99 0 1 0: 1 2 97 0 0 0| 0 0 | 0 0 | 0 0 | 926 863 | 0 0 0| 0 0 >
As mentioned in the summery that it is a powerful command to monitor system activity in great way. It has got the power of vmstat,iostat,mpstat,df,free and sar.Instead of firing each single command separately ,one can fire one single command to get all the info at once.But there is a way to get the individual information too. Please see the man page . You can get it from here : http://dag.wieers.com/home-made/dstat/
cat /proc/net/ip_conntrack | grep ESTABLISHED | grep -c -v ^#
This is sample output - yours may be different.
This is sample output - yours may be different.
[[ "$WINDOW" ]] && PS1="\u@\h:\w[$WINDOW]\$ "
This is sample output - yours may be different.
Add this to your $HOME/.bashrc file. It will only set this prompt if it is running inside screen ($WINDOW var is set)
Looks like this...
ion@atomos:~[2]$
< <infile> tr ' \t' '\n' | tr -s '\n' > <outfile>
This is sample output - yours may be different.
Puts words on new lines, removing additional newlines.
tr ' \t' '\n' <INFILE >OUTFILE
This is sample output - yours may be different.
Simply translates whitespace to newlines. Could be enhanced to compress out extra newlines, but that might be better handled in the next tool down the pipe, with eg uniq(1).
yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done
This is sample output - yours may be different.
function duf { du -sk "$@" | sort -n | while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done; }
This is sample output - yours may be different.
/usr/share/compiz $ duf *
4k text.xml
8k video.xml
12k session.xml
40k colorfilter.xml
92k staticswitcher.xml
184k shift.xml
356k animation.xml
1M reflection.png
su - <user> -s /bin/sh -c "/bin/sh"
This is sample output - yours may be different.
[root@XXX ~]# su - nobody
This account is currently not available.
[root@XXX ~]# su - nobody -s /bin/sh -c "/bin/sh"
sh-3.2$ id
uid=99(nobody) gid=99(nobody) grupos=99(nobody) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
watch -t -n1 "date +%T|figlet"
This is sample output - yours may be different.
_ ___ ____ __ _ _ _____
/ |/ _ \ _| ___| / /_ _| || |___ |
| | (_) (_)___ \| '_ (_) || |_ / /
| |\__, |_ ___) | (_) ||__ _/ /
|_| /_/(_)____/ \___(_) |_|/_/
This command displays a clock on your terminal which updates the time every second. Press Ctrl-C to exit.
A couple of variants:
A little bit bigger text:
watch -t -n1 "date +%T|figlet -f big"
You can try other figlet fonts, too.
Big sideways characters:
watch -n 1 -t '/usr/games/banner -w 30 $(date +%M:%S)'
This requires a particular version of banner and a 40-line terminal or you can adjust the width ("30" here).
expanded_script=$(eval "echo \"$(cat ${sed_script_file})\"") && sed -e "${expanded_script}" your_input_file
This is sample output - yours may be different.
With this command you can use shell variables inside sed scripts.
This is useful if the script MUST remain in an external file, otherwise you can simply use an inline -e argument to sed.
lynx -dump randomfunfacts.com | grep -A 3 U | sed 1D
This is sample output - yours may be different.
The only letter not appearing on the Periodic Table is the letter "J".
This is a working version, though probably clumsy, of the script submitted by felix001. This works on ubuntu and CygWin. This would be great as a bash function, defined in .bashrc. Additionally it would work as a script put in the path.
This is sample output - yours may be different.
This is sample output - yours may be different.
$ ls -l
...
-rwxr-xr-x@ 1 hai staff 24973 Mar 15 22:37 droopy*
-rw-r--r--@ 1 hai staff 92728 Feb 25 22:57 test report.m4a
-rwxr-xr-x 1 hai staff 6174 Feb 4 18:05 xml.tcl*
$ ls -hog
...
-rwxr-xr-x@ 1 24K Mar 15 22:37 droopy*
-rw-r--r--@ 1 91K Feb 25 22:57 test report.m4a
-rwxr-xr-x 1 6.0K Feb 4 18:05 xml.tcl*
I often deal with long file names and the 'ls -l' command leaves very little room for file names. An alternative is to use the -h -o and -g flags (or together, -hog).
* The -h flag produces human-readable file size (e.g. 91K instead of 92728)
* The -o suppresses the owner column
* The -g suppresses the group column
Since I use to alias ll='ls -l', I now do alias ll='ls -hog'
This is sample output - yours may be different.
Alias two dots to move to parent directory. Put it into your .bashrc or .profile file.