LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-07-2011, 11:30 AM   #1
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
What is your the most original command line trick/command you've come up with?


Just wanted to share some commands. See what other people have come up with.

I came up with this, to capture CDP packets:

Code:
tcpdump -nn -i eth1 -s 1500 -c 1 'ether[20:2] == 0x2000'
and I used this to change some HEX character to regular character:

Code:
find . -name "*.html" | xargs perl -pi -e 's|\xOLDHEXNUMBER|NEWTEXT|g'
List the last 50 RPM's installed in dated order:

Code:
rpm -qa --queryformat '%{installtime} (%{installtime:date}) %{name}\n' | sort -n | tail -50
 
Old 04-07-2011, 11:41 AM   #2
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
This fixes file names:

Code:
for i in *
do
  mv "$i" $(echo "$i" | tr [:upper:] [:lower:] | tr [:blank:] _ | sed 's|[^-._a-z0-9]||g')
done
changes upper to lower case, changes white space to _, and finally removes any character except those in the brackets.

There are many commands here:
http://www.commandlinefu.com/commands/browse
 
1 members found this post helpful.
Old 04-07-2011, 11:44 AM   #3
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Original Poster
Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
A function to run the Juniper Network connect client with user/pass and certificate.

Code:
NCremote() {
        cd /home/user/.juniper_networks/network_connect;
        echo "Signing into remote.google.com"
        echo "Rememeber to escape your password!"
        read -p "Username: " user
        read -p "Password: " pass
        java -jar NC.jar -h 4.4.4.4 -u $user -p $pass -f ../remote.google.com.cert -r "Google Remote Access" &
        cd ;}
 
Old 04-07-2011, 12:17 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
# also see this, this, this and this...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash Command Line Editor, while typing run another command before executing current? gumaheru Linux - General 5 04-13-2010 11:21 AM
LXer: The Linux Command Shell For Beginners: Fear Not The Command Line! LXer Syndicated Linux News 0 12-22-2008 06:30 PM
xine command line? or some other command line only engine? lumix Linux - Software 2 08-10-2007 10:46 AM
!(last command) trick? belorion Linux - General 5 07-03-2005 01:01 PM
old command line email trick LinuxLala Linux - General 4 03-11-2004 11:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration