The command-line is the interactive interface to your shell.

learn more… | top users | synonyms (1)

2
votes
1answer
317 views

Setting up clearcase view through nautilus file manager

On my workplace, in order to access certain folder on the server, say /x/y, I need to set up a clearcase view using the cleartool command. (I don't have much idea about clearcase or cleartool). Only ...
0
votes
1answer
293 views

Redirecting output of program reading from stdin

When I want to redirect an output of a.out program I will use ./a.out > output.txt This doesn't work when the program reads something from stdin. How would you redirect output in this case? I ...
10
votes
4answers
388 views

In bash, what are potential negative consequences of pausing a process with control-z?

Using bash, one can pause a process with control-z. However, are there any general circumstances or guidelines to beware of where a process would not behave well with being paused? My specific ...
3
votes
2answers
1k views

Chkconfig on Linux Mint 12 giving tons of errors

I'm trying to disable some services from starting at boot time on my Linux Mint 12 laptop. So I installed chkconfig, which has worked great for me before on Fedora. However, on Linux Mint 12, it gives ...
10
votes
4answers
3k views

'mv' equivalent of drag and drop with replace?

In a GUI environment, a drag-and-drop with replace will replace files and entire directories (including contents) with whatever is being copied in. Is there a way to accomplish this same intuitive ...
4
votes
2answers
3k views

command line tool to remove selected tags from mp3 files

Using MP3 Diags to clean up my mp3 collection, I've discovered that in addition to the ID3v2 tag, some files also have a Lyrics3, ID3v1, and some an APE tag. Are there command line tools out there to ...
10
votes
4answers
3k views

Command-line password manager that uses SSH key to authenticate

I'm looking for a command-line password manager, much like pwsafe, but one that features SSH key authentication. That is, I'd like to be able to add my SSH key to the authentication when opening the ...
0
votes
1answer
3k views

Is there a command line utility that copy files with progress information? [duplicate]

Possible Duplicate: move files with progress bar cp gets the job done but it would be nice if it had a little more feedback. Are there any utilities out there that do this? Personally, my ...
0
votes
1answer
241 views

Run a script after some command were executed

I have a list of scripts ./myscript <param> | grep "asd" ./myotherscript <param> <param> > file ... How can I automaticaly run another script when one of these command in the ...
3
votes
2answers
960 views

Is there any command-line, generic HTTP proxy (like Squid)?

I can easily use Netcat (or, Socat) to capture traffic between my browser and a specific host:port. But for Linux, does there exist any command-line counterpart of a Squid-like HTTP proxy that I can ...
1
vote
1answer
696 views

How to open a local URL (webpage) on the command line

On MacOS X I can run open /some/path/index.html and this would open the page index.html with the default software that handles .html files. Is there something similar on Ubuntu Linux? I have used ...
1
vote
2answers
512 views

How to change a firefox option on a quick way (via shortcuts, command line,..)?

In Firefox we have two options at Firefox->Preferences->Preferences->Fonts and colors->Colors menu, Use system colors and Sites can use other colors. I would like keep the first one ...
2
votes
1answer
170 views

Illustrate the difference of two squares via the command line

So, after 10 years of wanting to study the book that Ramanujan relied upon for a lot of his early strides in mathematics, it's 2012, and the book is finally online. To celebrate, I want to go through ...
3
votes
2answers
1k views

Passing a bash command-line argument containing a dot

How can a command-line argument containing a dot (.) be passed? Are there any escape sequences for capturing characters like dot? The following invocation of a bash-script from the shell does not ...
6
votes
2answers
1k views

Aliases and tmux

Aliases defined in .bash_aliases and .bashrc don't work in tmux. Can this be changed in some configuration, so the aliases work under tmux?
3
votes
1answer
406 views

Searching a file & excluding lines with a specified string

I have a large log file that contains numerous lines of the same entry, lets call it "repeat-info". As an example here is what a portion of the log might look like: [Timestamp] repeat-info ...
10
votes
4answers
1k views

Best method to collect a random sample from a collection of files

Suppose there is a directory holding 300 data files. I want to randomly select 200 of those files and move them into another directory. Is there a way to do that under Unix/Linux?
4
votes
3answers
351 views

Does bash have a built in caching command available (sort of like mktemp or sponge)?

I'm using the amazon ec2 command line tools, and the ec2-describe-instances tool is a little painful because of the 2-5 seconds it requires to make the request and display the output. I'm looking ...
1
vote
2answers
3k views

Batch copying/moving files in unix?

Is there a way to batch copy/move files in unix? I thought it might be an option for cp/mv but I can't find any way to do it.
2
votes
3answers
1k views

Removing apostrophe from all file names

I tried to remove apostrophe from all files' names in the directory. for i in *; do mv $i `echo $i | tr -d "'"`; done After executing this command nothing is renamed. Do you know what's wrong ...
3
votes
3answers
209 views

Regarding separate a single file into multiple files according to line separation

Currently, I have a plain text file, A, such as lowest priority very high significance. outstanding very novel In this file, every line contains a sentence. I want to separate this file into ...
1
vote
1answer
365 views

How to change the default line length for od and hexdump

Is there any way to change the default line length for the od and hexdump commands? Can't see anything apropriate in the man pages.
2
votes
1answer
3k views

How to get exact file size and file name?

Right now I am using ls -lt /my/directory (see below) then php parses the output. But inconsistently because the delimiter is space and there might be two or more spaces in between two fields. The ...
12
votes
2answers
598 views

What is a simple way to schedule a single event to happen at some time in the future?

There are often times that I want my computer to do a single task, but not right now. For example, I could have it notify me in 30 minutes that it is time to leave work. Or maybe I want it to run a ...
10
votes
2answers
347 views

Order of redirections

I don't quite understand how the computer reads this command. cat file1 file2 1> file.txt 2>&1 If I understand, 2>&1 simply redirect Standard Error to Standard Output. By that ...
1
vote
1answer
609 views

How to format a curl command for a special task?

There is a search page in a form http://site.com/search.php and it sends a search query via POST request. I want to fetch this request via curl command line tool to inspect a POST request. The HTML ...
5
votes
3answers
6k views

Recursive grep for words in a particular file type

I wanted a command line command to search all shell scripts in the filesystem for a particular word, so I asked around at work and got the following solutions: grep word `find / -name \*.sh ...
17
votes
12answers
19k views

Efficiently delete large directory containing thousands of files

We have an issue with a folder becoming unwieldy with hundreds of thousands of tiny files. There are so many files that performing rm -rf returns an error and instead what we need to do is something ...
0
votes
4answers
731 views

Renaming files works, but soft links point to the old names. How can I fix that?

For example, I'm renaming many files inside a tree like this: [bash]$ for file in `find . -name "*gsf*"`; do `mv $file ${file/gsf/msf}`; done That renames all the instances of "gsf" in file names ...
6
votes
2answers
4k views

Refresh/reload active browser tab from command line?

I'm trying to set up a custom toolchain where the browser (Firefox or, preferrably, Chrome) is often/frequently/constantly forced to refresh from the commandline. (The idea is to instantly see the ...
4
votes
2answers
1k views

How do I create a ZIP archive that preserves only the structure of the target directory and below?

I need to create a zip archive where the unzipped result preserves the directory structure from the specified directory down. I also need to do this without actually switching to the directory. My ...
1
vote
1answer
721 views

What does @ sign mean in 'ls' output on Mac OSX Lion terminal? [duplicate]

Possible Duplicate: what does the @ mean in ls -l? What does the @ sign mean in the following "ls" output? -rw-r--r--@ 1 root wheel 489 Jan 4 13:14 boot.plist
37
votes
4answers
1k views

cd by just typing the directory's name?

I either had this somewhere 20 years ago or I dreamed about it. Basically: If if type blobblob I get blobblob: command not found Fair enough. I would like it so that when my shell gets those ...
1
vote
1answer
372 views

How to display server's TLS certicicate details in terminal?

Having TLS certificate in local file, I can display its details using syntax like: openssl x509 -text -noout -in cert_filename Is there any way to display remote SMTP/POP3/HTTP server's TLS ...
3
votes
3answers
407 views

Unique file name for different files

I'm working with graphic design. I've downloaded many files (EPS files, PSD files, etc) from various websites. Because it come from various websites, after downloaded from more than 10 different ...
3
votes
3answers
733 views

command line audio with mpg123 - how to save position in audio and begin from that location next time?

I am contemplating using mpg123 as an audiobook player. I can't find any other good audiobook players for Linux, and I think mpg123 may be my best option. My audiobooks are organized by directories ...
1
vote
1answer
27 views

How reliable of using “nameofmychoice=”anyname“”

For backup MySQL MyISAM database, I'm using: backupdb=siteone mysqldump -u root -pthepass --lock-tables --add-locks --disable-keys --skip-extended-insert --quick $backupdb > /var/www/html/db2.sql ...
2
votes
2answers
1k views

regex replace text in xml file within node from the command line

I have an XML file and I would like to replace everything that is between the open and closing tag within multiple instances of the g:gtin node with nothing. Is this possible from the command line, ...
1
vote
1answer
1k views

Sending HTML with Mutt (or another terminal mail client)

While I can find some scattered info on the topic, I can't seem to find a straight walkthrough (or even a definite answer)... Basically I'm too low on the totem pole to start sending plain-text ...
1
vote
1answer
312 views

Unable to kill sar process

I have a shell script to run JMeter test. Script generates the Jmeter log out put and creates sar (suppose to create sar file though it does not). Shell script is - runtest() { export ...
4
votes
3answers
1k views

How can I expand a relative path at the command line, with tab completion?

In bash is there any way to expand a relative path into an absolute path, perhaps with tab completion? I ask because sometimes I will search for a file, find it, then vim it: cd /etc cd apache2 cd ...
4
votes
1answer
988 views

How to create a confirmation question in Linux?

I have a certain command (git push server-name) that has major consequences. How to require confirmation for this command only? It should ignore white space. The confirmation could be Enter 'yes i am ...
3
votes
1answer
2k views

What does “Invalid argument” mean in Solaris?

-bash-3.00$ ./p4 -V -bash: ./p4: Invalid argument What does "Invalid argument" mean in Unix? More details: p4 is an executable in the current directory. p4 actually refers to perforce. The option ...
0
votes
2answers
317 views

Functional shell scripting [closed]

I found out that when I want to create some shell script or advanced command it always made me trouble to remember the names of the commands and their switches. e.g. tr -d '\n' < file | wc -c ...
4
votes
2answers
2k views

pdf viewer for command line only

Is it possible to view pdf documents without having gdm (or similar) running? Rationale: I'm working on a remote server (assume no X forwarding) processing some data, creating some plots (assume pdf ...
2
votes
2answers
589 views

List of available command options?

I'm currently setting up my first web server without a control panel and so far things are going pretty good! I was just wondering if anyone could direct me to somewhere that explains all of the ...
5
votes
2answers
154 views

What's the “Unix way” for a CLI app to report no arguments specified?

I'm developing an application which I'd like to follow the "Unix way." What should I program it to do in case it is called with no arguments (which makes no practical sense): display an error ...
0
votes
2answers
115 views

How to act on output from a failed command [duplicate]

Possible Duplicate: What is the easiest way to execute text from tail at the command line? I was guessing the ouput of a command that fails to execute should be sent to stdout and hence can ...
0
votes
1answer
1k views

How to pkill from a script?

How can I write a script that basically just runs pkill -HUP inetd? I want to restart inetd via a script so I can schedule it to run at a particular time. I tried to write it myself, but I'm getting a ...
5
votes
1answer
5k views

Encode with ffmpeg using avi to mp4

What command lines to use to convert from avi to mp4, but without destroying the framesize and making the file small as the original size or a little bit bigger, and same thing with mp4 to avi? ...