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

learn more… | top users | synonyms (1)

22
votes
5answers
25k views

How do I convert an epoch timestamp to a human readable format on the cli?

How do I convert an epoch timestamp to a human readable format on the cli? I think there's a way to do it with date but the syntax eludes me (other ways welcome).
1
vote
3answers
733 views

Unzipping a batch of files

When I try unzip filename.zip it works. However, I need to unzip a series of zip files. Why are: find . -name "*.zip" -print0 | xargs -0 unzip or ls *.zip | xargs unzip not working? In ...
2
votes
1answer
111 views

cp : short way of copying [closed]

I don't remember exactly but there was either cp or mv command which I was able to do something like this with: cp file{.cpp, .cpp.org} Which would copy file.cpp and make a copy named file.cpp.org. ...
8
votes
9answers
5k views

linux diff tools: create list of modified files

How do I create a list of modified files programmatically using linux command line tools? I'm not interested in the difference in any particular file (delta, patch). I just want to have a list of new ...
1
vote
1answer
163 views

How do I time how long my pg_restore takes in the command line?

I'm trying to track the amount of time the process takes for when I move around my data and upgrade my web app. From the command line, how would I track the amount of time elapsed from when the ...
4
votes
4answers
1k views

Why cat, grep and other commands can't understand files starting with minus sign? [duplicate]

If I have a file which name starting with single or several minus sign, for example --1 it can't be used as a parameter of many commands. Even if I run cat --1 instead of file content I get ...
2
votes
1answer
2k views

Start 4 programs on startup in Linux Mint via terminal

I'm working on a project and I hope you can help me solve a problem. I have four programs that are written in C. They have been compiled using gcc and they work as they should. Because the four ...
6
votes
1answer
811 views

Find links and their positions in a PDF

I need to find all links in a PDF file, along with the page they're on and their X/Y position. Is there any tool or combination of tools I can use to do that?
15
votes
3answers
4k views

Command for forcing a pointer ungrab (captured mouse release)

Sometimes Firefox doesn't release the mouse after dragging, so I need to kill the application to force it to release its pointer grab. Is there any command to force an application to ungrab the ...
1
vote
0answers
148 views

convert WAV music library to FLAC on command line and achieve best quality

I would like to produce (nearly) perfect FLAC files by verifying/checking all conversion steps. I'm hoping to do this in a single command, although a short bash script would be acceptable as a second ...
1
vote
2answers
222 views

shell saves ip address that you ping? [duplicate]

I was once shown a shortcut that I can't recall/ find. After pinging an ip, then attempting to ssh into it - the ip was saved into to a variable automagically. Something like: ping 10.1.23.4 ...
3
votes
3answers
2k views

How to lock on Solaris 10?

On Linux I use flock lock command to execute a command with an exclusive lock. What is the standard operating system command of Solaris 10 to do the same in a shell?
0
votes
2answers
199 views

The difference that quotation marks make in find command [duplicate]

When I have a nested directory find . -name "*.py" -print command gives me all the python scripts beneath current directory. However, find . -name *.py -print returns only the python scrips in current ...
3
votes
1answer
1k views

Mutt imap multiple account

My first question on this site, I come quickly. I'm a fan of command line tools and text-based application. I use tmux with a minimalist tiling wm is qtile, I can not change the environment. I'm a ...
5
votes
3answers
245 views

find all end subdirectories in a tree

given the following structure: oz123@debian:~/ $ tree . . ├── a │ ├── a1 │ ├── a2 │ └── a3 ├── a1 │ ├── a11 │ ├── a12 │ └── a31 ├── b │ └── b1 │ ├── b11 │ │ └── b21 │ ...
0
votes
3answers
919 views

How can I start a process using cpulimit?

I am trying to use cpulimit for testing an app I'm developing under low resource conditions, and I need the process to start under the influence of cpulimit. It is not sufficient to start the program ...
3
votes
2answers
98 views

How to switch to editing command in text editor [duplicate]

When typing a complicated command that started on the command line in Bash, how do I switch to editing it with ViM?
1
vote
1answer
204 views

How can I blank the desktop via the command line?

How can I programmatically make my desktop blank (i.e. remove the icons and make it black) from the command line? I'd also like to be able to restore it afterwards. Multiple solutions are OK, Ubuntu, ...
1
vote
1answer
359 views

How can I move between words in the command prompt in tcsh in linux?

I want a feature like vim's going forward or backwards command (w,e,ge,b) etc in the shell prompt. I am using tcsh shell in Linux. I would like to go 'n' number of words backs or forward etc and do ...
1
vote
0answers
167 views

Can't unlock a file for path change

I'm trying to order the path entries on my mac, but it seems that my /etc/paths file is Locked. I tried the instructions on this link, but I can't save the file as it is locked. I even tried chflags ...
10
votes
2answers
2k views

What is meant by a shell is in “vi” mode or “emacs” mode?

This question follows directly from the answer to one of my previous questions here. I am newbie to unix world and this site has helped a lot to understand some core concepts. In this case I am ...
3
votes
2answers
115 views

Can I run a command after the user uses Ctrl-C to kill a command?

So at my position we use a shared set of aliases to do builds. Something like... alias 'build'='cd $BUILD_ROOT; m; cp ...; cp...; deploy; deploy; deploy; cd -' This is super irritating because the ...
5
votes
2answers
740 views

Is there a way to simulate a “Close” event on various windows using the terminal?

I answered on Ask Ubuntu Quit all instances of gnome-terminal via a command but as you all can read gnome-terminal didn't seems to have a SIGcall I could use to simulate this "Close" event. So this ...
1
vote
1answer
171 views

How can I clear portion of what is typed into the prompt while working on Linux and using C-shell?

I am working in Linux and C-shell. Often times I would require to change some portion of what is there already in the prompt that I obtain from reverse searching through the history command by use of ...
4
votes
3answers
1k views

How to find first match in multiple files

Is there a way for the find command to search for the first match or occurrence of a string or pattern within each of multiple files? I've been using the usual syntax: find dir -iname '*.ext' -exec ...
2
votes
2answers
94 views

How can I execute a shell script that exists in a longish path with a single command without first cd'ing to the directory?

In Linux I always cd to a longish path and then run the script: cd /scratch/someDir/someOthernestedDir/ ./shellscriptName.sh How can I avoid achieve typing this longish path and then executing ...
1
vote
2answers
50 views

Can I see in history output from which directory I had actually issued a command?

CTRL+R allows me to reverse search through the command history which is great but can I also find out from which directory that command was run? I am using C-shell in Linux.
1
vote
2answers
1k views

How to specify attachment encoding in mutt command line?

I'm trying to send an email with attachment from a perl script. First, I create the attachment (an xml file): open(XMLFILE, ">:utf8", $xmlfile); print XMLFILE "<?xml version=\"1.0\" ...
0
votes
1answer
125 views

how to remove a file named “-f” from the command-line? [duplicate]

Here are some options a) rm -f b) rm "-f" (double quotes) c) rm '-f' (single quotes) d) all of the above e) none of the above
3
votes
1answer
213 views

How do I access a flash drive that has been ejected without physically plugging it out and back in? [duplicate]

When I plug in my flash drive, it gets auto-mounted. If I right click on the drive and select 'eject', then it's unmounted. Now, I want to remount the drive in Terminal. How do I do this? I've ...
19
votes
4answers
16k views

How to attach terminal to detached process?

I have detached a process from my terminal, like this: $ process & That terminal is now long closed, but process is still running and I want to send some commands to that process's stdin. Is ...
-1
votes
1answer
93 views

How to use the “source” command to do parallel computing?

For example, I have an executable called ex01 (C++ program). And I have a text file that contains a set of invocations of this program with different arguments. The text file looks like this: ...
0
votes
2answers
455 views

How to stop Rainlendar from hiding on the Linux Mint desktop?

Rainlendar is a great tool to keep events and tasks on the desktop (I did not find a better solution yet). The problem is that the application completely hides if you press: The "Show Desktop" ...
8
votes
4answers
675 views

Understanding different Linux Distros

I'm having a little bit of confusion when understanding linux based OS's. When I download the newest version of Mint and Ubuntu, aren't they the "same" at their core (kernel)? It just seems that they ...
1
vote
0answers
90 views

boot updated kernel image on beagleboard

Boot updated kernel image on beagleboard. I had installed a kernel on Beagle-board to update image of kernel to it. I've used this command: $ sudo apt-get install linux-image-3.2.0.49-omap It ...
3
votes
1answer
429 views

How can I stress test a command line tool?

I'd like to try to stress-test a PHP script I've written, which accesses the filesystem, to see how it copes with load and parallel access. I'd like to run this script x times in y different ...
3
votes
4answers
522 views

How to get the id of a very short child process if the parent is known?

I'm looking for a way to get the PID of a short child process in Linux. The process is instant from a human perspective. I know the parent process which will spawn the child process. Is there a way ...
3
votes
1answer
517 views

How to pipe diff into Kompare?

I want to quickly compare files in two different directories to see if the files are the same (same content). I want to see the results in Kompare (I'm on KDE - Kubuntu 12.04). Here's my diff ...
2
votes
3answers
370 views

Trying to send HTML mail on mac OSX Mountain Lion

I'm trying to send email with an html file as the body (it's actually a cucumber results report if that matters) or an attachment (if sending it as the body does not work) via the command line I've ...
2
votes
2answers
3k views

Bash (single line): Execute 2nd command if first succeeds, execute 3rd if it doesn't?

I want to execute two commands one after another via SSH. I don't have an interactive shell. The second command should only execute if the first one succeeds, but the line is inside a script, so I'd ...
1
vote
2answers
333 views

Getting specific line from terminal output

"Hmm, I need to edit file-i-must-edit-2, but I cannot remember where it is." locate file-i-must-edit /home/user/file-i-must-edit-1 /home/user/file-i-must-edit-2 /home/user/file-i-must-edit-3 ...
1
vote
2answers
278 views

MacOsx - Shell - list all .php files and their octal permissions, inside a specifc folder

is it possible to list all the ".php" files located into a direcotry and their octal permissions? I would like to list them like this: 775 /folder/file.php 644 /folder/asd/file2.php etc...
3
votes
1answer
332 views

Use time ,timeout and ulimit commands properly

I'm running a command in CentOS and at the same time I want to do 2 things: write the run time of the command to a file and set a time limit which stops the command I implemented the first one ...
1
vote
2answers
97 views

Package name suggestion in fedora

In Ubuntu when an app is not installed and in Terminal you type for example gvim it says that this app is contained in package vim-gnome and try installing that but in fedora that doesn't happen with ...
1
vote
1answer
188 views

mutt weird action

I wrote a little script to send multiple mails from a list with differents subjects. #!/bin/bash while read -a line do mailadd=${line[0]} subject=${line[1]} mutt -s `echo $subject` `echo ...
2
votes
1answer
143 views

How can I work around the program failing if there is *any* stdin?

For example, the following works fine: /usr/bin/program It produces some output, and gets to result. But if I invoke it like this: echo -n | /usr/bin/program or this echo -n | bash -c ...
1
vote
3answers
214 views

how to run recursively “touch empty” if a folder is empty?

I want to maintain a folder structure that contains empty folders when I add a project to Git. As everyone knows, Git doesn't track empty folders. So you need to add some kind of placeholder inside of ...
0
votes
1answer
134 views

how to list all the internet's IP ranges? [closed]

I was wondering if I list all the IP ranges directly available on the internet. perhaps also group them by country and ISP? I know that a lot of people do research nowadays on datamining and ...
1
vote
1answer
1k views

Configuring Real VNC on RHEL 6.3 Command Line

I am trying to setup real vnc server on my RHEL via command line. I have done the following steps Downloaded the Real VNC installer from Real VNC for Red Hat 64 bit system Unizipped it to get to ...
6
votes
1answer
4k views

Better way to add alternative using update-alternatives?

I'm sorry for my bad writing, I'm not a native speaker. I've looked up the manual of update-alternatives several times but I can't find out how to show the current link pointing to a specific ...