commandline session $ls store store1 $pwd /home/jeffrin/Test $stat store File: ‘store’ Size: 19 Blocks: 8 IO Block: 4096 regular file Device: 801h/2049d Inode: 7036935 Links: 1 Access: (0644/-rw-r–r–) Uid: ( 1000/ jeffrin) Gid: ( 1000/ jeffrin) Access: 2013-06-29 18:37:33.000000000 +0530 Modify: 2013-06-29 18:37:30.000000000 +0530 Change: 2013-06-29 18:37:30.000000000 +0530 Birth: – $stat -f store File: “store” …
Monthly Archives: June 2013
tee . using examples
commandline session $ls | tee $ls -l | tee total 0 $pwd | tee /home/jeffrin/Test $pwd /home/jeffrin/Test $pwd | tee store /home/jeffrin/Test $cat store /home/jeffrin/Test $pwd > store1 $cat store1 /home/jeffrin/Test $ http://pluto.infoclub.in/wp-content/uploads/2013/06/tee.c
free . low and high memory statistics
$free -lh total used free shared buffers cached Mem: 1.9G 1.8G 80M 0B 343M 449M Low: 1.9G 1.8G 80M High: 0B 0B 0B -/+ buffers/cache: 1.0G 873M Swap: 5.6G 348K 5.6G $
nc netcat
commandline session $nc 127.0.0.1 25 220 debian.Jeff ESMTP Exim 4.80 Thu, 27 Jun 2013 00:05:20 +0530 ^C $nc gnu.org no port[s] to connect to $nc gnu.org 25 ^C $nc -g gnu.org 25 no port[s] to connect to $nc -g gnu.org gnu.org 25 ^C $nc -g 127.0.0.1 127.0.0.1 25 ^C $nc www.youtube.com no port[s] to connect …
pstree display a tree of processes
commandline session $pstree -A jeffrin at-spi2-registr—{at-spi2-registr} dbus-daemon dbus-daemon dbus-launch dbus-launch dconf-service—2*[{dconf-service}] gconfd-2 gnome-session-+-at-spi-bus-laun-+-dbus-daemon | `-3*[{at-spi-bus-laun}] |-bluetooth-apple—{bluetooth-apple} |-gdu-notificatio |-gnome-fallback—-2*[{gnome-fallback-}] |-gnome-panel-+-chrome-+-chrome | | |-chrome-sandbox—chrome-+-chrome-+-chrome—11*[{c+ | | | | `-3*[chrome—3*[+ | | | `-nacl_helper_boo | | `-31*[{chrome}] | |-gnome-terminal-+-bash—pstree | | |-bash | | |-gnome-pty-helpe | | `-3*[{gnome-terminal}] | `-3*[{gnome-panel}] |-gnome-screensav—2*[{gnome-screensav}] |-gnome-settings–+-sh | `-3*[{gnome-settings-}] |-gnome-sound-app—{gnome-sound-app} |-metacity—3*[{metacity}] |-nm-applet—3*[{nm-applet}] |-notification-da—{notification-da} …
using quotes with GNU Bash
commandline session $echo ‘hello’ hello $echo “hello” hello $echo ‘ls’ ls $echo `ls` $echo `ls -l` total 0 $echo ‘ls -l’ ls -l $
true and false notes
A UNIX Command $true $echo $? 0 $false $echo $? 1 $ $ ./true –version >&- ./true: write error: Bad file number $ ./true –version > /dev/full ./true: write error: No space left on device UNIX Explanation true – do nothing, successfully exit with a status code indicating success. false – do nothing, unsuccessfully exit …
setterm
commandline session $setterm -underline $ls $ls -l total 0 $ls -a . .. $setterm -underline off $ls $ls -l total 0 $ls -a . .. $ http://pluto.infoclub.in/wp-content/uploads/2013/06/setterm.c
dig DNS lookup utility
commandline session $dig ; <> DiG 9.8.4-rpz2+rl005.12-P1 <> ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44167 ;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;. IN NS ;; ANSWER SECTION: . 17373 IN NS a.root-servers.net. . 17373 IN NS b.root-servers.net. …
true from coreutils
commandline session $true $echo $? 0 $true hello $echo $? 0 $ http://pluto.infoclub.in/wp-content/uploads/2013/06/true.c