Post your Command line tricks
Forum rules
Share your brain ;)
Share your brain ;)
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Post your Command line tricks
Just found it: https://github.com/ardagnir/athame
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu
- wuxmedia
- Grasshopper
- Posts: 6454
- Joined: Wed Oct 17, 2012 11:32 am
- Location: Back in Blighty
- Contact:
Re: Post your Command line tricks
now that looks nice, need to get my vim on now :)
Thanks stark !
Thanks stark !
- wuxmedia
- Grasshopper
- Posts: 6454
- Joined: Wed Oct 17, 2012 11:32 am
- Location: Back in Blighty
- Contact:
Re: Post your Command line tricks
one I learnt today:
To prevent boot up of certain things.
Code: Select all
update-rc.d -f <service> remove
Re: Post your Command line tricks
nice, I didn't know that. I used chkconfig for that. I'm using openrc now, where you can perform similar actions
Code: Select all
rc-update [add|remove] <service> [runlevel]
Work hard; Complain less
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Post your Command line tricks
Code: Select all
dpkg-query -W --showformat='${Installed-Size;10}\t${Package}\n' | sort -k1,1n
..gnutella..
- Dr_Chroot
- Alfalfa
- Posts: 1100
- Joined: Mon Jun 09, 2014 9:49 pm
- Location: among the sagebrush
- Contact:
Re: Post your Command line tricks
^ This is fantastic. Set as a bash alias :)
Fight internet censorship.
EFF | Tor Project | Bitcoin
"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden
EFF | Tor Project | Bitcoin
"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden
Re: Post your Command line tricks
^^ Thanks for the share, Sir Bacon. I, too, have this as an alias now :)
Out of the corner of your eye you spot him... Shia LaBeouf.
https://www.youtube.com/watch?v=o0u4M6vppCI
https://www.youtube.com/watch?v=o0u4M6vppCI
- Dr_Chroot
- Alfalfa
- Posts: 1100
- Joined: Mon Jun 09, 2014 9:49 pm
- Location: among the sagebrush
- Contact:
Re: Post your Command line tricks
Neat little write-up. https://github.com/jlevy/the-art-of-command-line
Fight internet censorship.
EFF | Tor Project | Bitcoin
"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden
EFF | Tor Project | Bitcoin
"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden
Re: Post your Command line tricks
Julius, you are the BASH script king :)
cheers
simon
cheers
simon
Someone told me that I am delusional, I almost fell off my unicorn.
Re: Post your Command line tricks
So after a bit of a struggle I cleaned up my ~/.bashrc :D
Thanks to dkeg for suggesting me previously to use the absolute path ( i.e. /home/stark/ ) which also flawlessly works.
Thanks to dkeg for suggesting me previously to use the absolute path ( i.e. /home/stark/ ) which also flawlessly works.
Code: Select all
profile="$HOME/.profile"
shell_aliases="$HOME/etc/shell/bash/aliases.bash"
shell_functions="$HOME/etc/shell/bash/functions.bash"
files="$profile $shell_aliases $shell_functions"
for setup_file in $files; do
test -f "$setup_file" && . $setup_file
done
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu
Re: Post your Command line tricks
Code: Select all
sudo iwlist wlan0 scan | grep Frequency | sort | uniq -c | sort -n
to see which channels your modem supports, use
Code: Select all
iwlist wlan0 channel
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.
- Dr_Chroot
- Alfalfa
- Posts: 1100
- Joined: Mon Jun 09, 2014 9:49 pm
- Location: among the sagebrush
- Contact:
Re: Post your Command line tricks
^ Sweet! Thanks rho.
Fight internet censorship.
EFF | Tor Project | Bitcoin
"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden
EFF | Tor Project | Bitcoin
"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden
Re: Post your Command line tricks
from here: http://stackoverflow.com/questions/1323 ... ng-process
1. find process
2. find connections of process:
1. find process
Code: Select all
┌┤rhowaldt@lalala [~]
└──┤$ ps aux | grep nicotine
rhowaldt 19459 0.0 0.1 4552 2104 pts/2 S+ 04:09 0:00 grep --color=auto nicotine
rhowaldt 29892 4.4 3.5 160016 72628 ? Sl Jul20 12:34 /usr/bin/python /usr/bin/nicotine
Code: Select all
┌┤rhowaldt@lalala [~]
└──┤$ ls -l /proc/29892/fd
total 0
lr-x------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 0 -> pipe:[1484919]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 1 -> /dev/tty1
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 10 -> /home/rhowaldt/.nicotine/config.wordindex.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 11 -> /home/rhowaldt/.nicotine/config.buddywordindex.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 12 -> /home/rhowaldt/.nicotine/config.fileindex.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 13 -> /home/rhowaldt/.nicotine/config.buddyfileindex.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 14 -> /home/rhowaldt/.nicotine/config.mtimes.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 15 -> /home/rhowaldt/.nicotine/config.buddymtimes.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 16 -> socket:[1484517]
lr-x------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 17 -> anon_inode:inotify
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 18 -> anon_inode:[eventfd]
lr-x------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 19 -> /proc/29892/mounts
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 2 -> /dev/tty1
lr-x------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 20 -> pipe:[1485295]
l-wx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 21 -> pipe:[1485295]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 22 -> socket:[1485974]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 23 -> socket:[9280199]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 24 -> socket:[9280208]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 25 -> socket:[9280706]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 26 -> socket:[9281548]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 27 -> socket:[9281549]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 28 -> /home/rhowaldt/.nicotine/incompletefiles/INCOMPLETE38fad79680e0bf38dbb5cd7be4022a9bKing Oliver - One More Time 15-4-1931.MP3
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 29 -> /home/rhowaldt/.nicotine/incompletefiles/INCOMPLETE1fb6be07cfcf2da2df038bddcd02f32209 Sensation Rag.mp3
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 3 -> /home/rhowaldt/.nicotine/config.files.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 30 -> socket:[9283829]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 31 -> socket:[9075282]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 32 -> /home/rhowaldt/.nicotine/incompletefiles/INCOMPLETEa2f94f84cf9d500e95908b9710d0e7727 - Memphis Blues (Or, Mister Crump).m4a
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 33 -> /home/rhowaldt/.nicotine/incompletefiles/INCOMPLETE3cc0b04af822b47fadd65eb60437e30fwilli mae 'big mama' thornton - the big change.mp3
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 4 -> socket:[1484509]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 5 -> anon_inode:[eventfd]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 6 -> /home/rhowaldt/.nicotine/config.buddyfiles.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 7 -> /home/rhowaldt/.nicotine/config.streams.db
lr-x------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 8 -> /dev/urandom
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 9 -> /home/rhowaldt/.nicotine/config.buddystreams.db
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.
- wuxmedia
- Grasshopper
- Posts: 6454
- Joined: Wed Oct 17, 2012 11:32 am
- Location: Back in Blighty
- Contact:
Re: Post your Command line tricks
What's my public IP? maybe I need it in a script and don't want to fuck around with a browser and whatsmyip.com?
or for the esoteric who happen to be behind a port 80 blocked FW:
requries dig (dnstools pkg)
Thanks to Rusty.
Code: Select all
wget http://ipinfo.io/ip -qO -
Code: Select all
dig +short myip.opendns.com @resolver1.opendns.com
Thanks to Rusty.
- rust collector
- Motörhead
- Posts: 536
- Joined: Mon Jan 13, 2014 3:56 pm
- Location: no_nb
Re: Post your Command line tricks
Nope, thanks to WüX
You knew how, I did not...
You knew how, I did not...
- ivanovnegro
- Minister of Truth
- Posts: 5451
- Joined: Wed Oct 17, 2012 11:12 pm
Re: Post your Command line tricks
Very cool Wux.
- wuxmedia
- Grasshopper
- Posts: 6454
- Joined: Wed Oct 17, 2012 11:32 am
- Location: Back in Blighty
- Contact:
Re: Post your Command line tricks
TBH bacon posted something like this - maybe not in this topic.
Re: Post your Command line tricks
Thanks, wux.
- Dr_Chroot
- Alfalfa
- Posts: 1100
- Joined: Mon Jun 09, 2014 9:49 pm
- Location: among the sagebrush
- Contact:
Re: Post your Command line tricks
Oh ho ho, this is valuable. Thanks!
Fight internet censorship.
EFF | Tor Project | Bitcoin
"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden
EFF | Tor Project | Bitcoin
"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden