Another 10 good Unix habits to pickup

Welcome to Linux Screw! If you're new here, you may want to subscribe our RSS feed.

Well, IBM publishes a new article about useful Unix command line habits as a follow-up to Michael Stutz’s article. I promise that after reading this article you will say something like “A-ha, I didn’t know you could do that!” :) Here is the part of that staff:

The !$ command returns the last argument used with a command. But what happens if you have a command that used arguments and you want to reuse just one of them? The !:1 operator returns the argument used in a command. The example in Listing 3 shows how you can use this operator in combination with the !$ operator. In the first command, a file is renamed to a more meaningful name, but to preserve use of the original file name, a symbolic link is created. The file kxp12.c is renamed in a more readable manner, then the link command is used to create a symbolic link back to the original file name, in case it’s still used elsewhere. The !$ operator returns the file_system_access.c argument, and the !:1 operator returns the kxp12.c argument, which is the first argument of the previous command.

Listing 3
$ mv kxp12.c file_system_access.c
$ ln –s !$ !:1

Read more here

unix front

 
 
» You might also be interested in the following articles:
10 good Unix habits to pick up
Two-way conversion of Unix time (seconds since 1970) and regular time
BMW migrates FROM Unix on race to Intel
Manage gzip files on-the-fly (zcommands)
Quick shell change for user in Unix or Linux



» Want to stay up to date? Subscribe to our E-MAIL or RSS feed!


0 Responses to “Another 10 good Unix habits to pickup”


  1. No Comments

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word




Friendly Sites:Who is behind Linux Screw?
Aspiring Sysadmin | GeekyBits³ | Bash Cures Cancer | TOTMS
Linux Operating System | Small Linux Deployments | My SysAd Blog
The Danesh Project | ZEPY | LinuxHaxor.net | Planet Sysadmin
The Sys Admin | {buhay sysad} | a non-geek's linux notes
Linux HOWTOs, Tutorials & Projects with Adam Palmer | LinuxAlt.Com
My name is Artem Nosulchik (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››