one or a set of directive issued in the *nix environment to get information, change state of something or to execute something; in other word to gain an objective.

learn more… | top users | synonyms

1
vote
1answer
143 views

What is the extended version of the “sl” command?

Recently I've been discussing Unix humor with a friend and we got to the topic of the sl command. I got the sources, compiled, installed on our development machine, and... got rather disappointed. The ...
3
votes
2answers
158 views

Redhat Linux: How to know my system configuration?

I am using Red Hat Enterprise Linux Server release 5.9 (Tikanga). For installation of any application, it is very important to know the system configuration, is it 32 bit or 64 bit system, Installed ...
5
votes
2answers
197 views

Get the actions for a command programmatically

Let's take the git example: $ git<TAB><TAB> git git-import-dscs git-shell git-buildpackage git-import-orig git-upload-archive git-dch git-pbuilder ...
73
votes
3answers
7k views

Why is “echo” so much faster than “touch”?

I'm trying to update the timestamp to the current time on all of the xml files in my directory (recursively). I'm using Mac OSX 10.8.5. On about 300,000 files, the following echo command takes 10 ...
1
vote
1answer
29 views

`tar` with `find` with removing original file extension

I want to create tb2 files from bunch of text files like this. tar cfj $(basename ./2014_04_09.txt .txt).tb2 $(basename ./2014_04_09.txt) With this command I can create a archive file 2014_04_09.tb2 ...
11
votes
7answers
2k views

What is the symbol *.* called?

What's the name for the *.* symbol and what is its significance?
-3
votes
1answer
34 views

In what directory can I find the list of terminal commands or the set of scripts that give each one its purpose/power?

Is it hidden or accessible? Also, can you create a new script and define a new command to execute system-wide by adding it to this directory and giving it the same privileges?
3
votes
5answers
186 views

find which system is transmitting through a particular port

I am using command nc -lu <port no.> to find on given port any data is receiving or not. I am getting data if there is transmission going on (but don't know from where!). Is there any way that ...
1
vote
2answers
10 views

Install-on-Demand Wrapper Function for Executables

How do I make the following function work correctly # Install git on demand function git() { if ! type git &> /dev/null; then sudo $APT install git; fi git $*; } by making git $* ...
5
votes
3answers
2k views

Why doesn't ln -s tell that it fails when creating a symlink to an existing symlinked directory?

When running (on linux different ubuntu variations): >ln -s dir_1 symlink_dir >ln -s dir_2 symlink_dir It fails without telling that it fails. But if you do the same thing on a file instead ...
1
vote
1answer
28 views

How to start an application as GNOME would by command line?

How would I start an application (by launcher) the exact same way as GNOME would, in a command line interface? I want to set some environment variables. I know I can check the launcher file for the ...
1
vote
0answers
65 views

Kill Command in linux using bash script [migrated]

I have a bash script abcd.sh,in which I want to kill this command(/usr/local/bin/wrun 'uptime;ps -elf|grep httpd|wc -l;free -m;mpstat') after 5 sec but in this script it kill sleep command after 5 ...
0
votes
1answer
24 views

Is there any command to list all related files and folders to specified file in macosx?

I have many ctags in my macosx. When doing which ctags, it gave me /usr/bin/ctags. But I also want to know where is all related folders and files to this /usr/bin/ctags Any useful command?
1
vote
0answers
22 views

Printing short latex snippets

Is there a way to quickly (render and) print short latex snippets like single equations? Something similar to echo "Some text" | lpr like make-latex-image "$\frac{some}{equation}$" | ...
14
votes
2answers
467 views

Is there something like `time` that also records I/O and CPU?

I can pretty quickly monitor the running time of a process with time: x@y ~ $ time foo real 0m14.299s user 0m4.770s sys 0m0.440s Is there a way I can get the same data for ...
1
vote
1answer
20 views

Escaping dash in `dch` call

I'm using dch to modify the changelog for a debian package that is being built using some bash script. The messages for changelog are taken from some data source and are just passed to dch --append. ...
0
votes
1answer
39 views

feeding the password without any terminal window (stdout)

I have a command like this: echo "12345" | sudo abcde where 12345 is supposed to be the root password and abcde a program or a command. I have a shortcut which runs this command. I have tested the ...
1
vote
2answers
80 views

How to get SCP execution time in milliseconds?

I have a script in which i am reading source and destination IP address from a csv file and recording the time in milliseconds it is taking to copy the file from source to destination (using scp). ...
25
votes
2answers
4k views

How to stop the find command after first match?

Is there a way to force the find command to stop right after finding the first match?
0
votes
3answers
52 views

Remove extra line break from a variable

I am an absolute newbie to the *ix ,so if my question is dumb please bear with me. I am writing a script where I am trying to export some variable , and after exporting my variable when I am printing, ...
21
votes
4answers
1k views

Is the shell permitted to optimize out useless terminating commands?

If a shell is asked to perform a probably useless (or partially useless) command known to terminate, such as cat hugeregularfile.txt > /dev/null, can it skip that command's execution (or execute a ...
4
votes
2answers
230 views

Command completion does not complete the files in the current directory

Something is wrong with my tab completion. Let's say I do this: cd test // works fine, go into test directory ls // works fine, displays all of the files Let's assume I have the following files: ...
20
votes
2answers
528 views

How do I move all files output from a command?

I have this grep command to find files without the word Attachments in them. grep -L -- Attachments * I want to move all the files that are output from that command. How do I do that in bash? Do I ...
-1
votes
3answers
52 views

How to know in which distribution is present one command [closed]

How can I know the Linux distribution of the command? For example, lscpu command Is there any place with a matrix (distribution, commands)?
2
votes
2answers
43 views

netstat command doesnt work anymore on the new dedicated server

I was using the following command on my previous dedicated server with the same version of the FreeBSD installation: # uname -a FreeBSD 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 ...
2
votes
2answers
89 views

How can I restore file timestamps of video recordings using the embedded metadata?

I'm looking for a command that will read the metadata of a ‘*.mp4’ file and touch the file's timestamp with the creation time of the video. The command should be read-only with respect to the file ...
2
votes
1answer
14 views

Retrieve system commands without reading sources

Sometimes I wonder how Linux programs achieve certain results knowing that they internally use system calls (system() or exec() in C programs). Given a working binary I wonder if it is possible to ...
1
vote
1answer
48 views

Command to Download Source Files in FreeBSD

In most Linux distros there is a command sometimes the same one used to install or build (compile) packages with extra switch; which just download the source files instead of building or installing ...
1
vote
1answer
104 views

How can I pipe commands to any terminal?

I often use more than one terminal (or terminal emulator) at a time; and while in X I can copy-paste commands, besides not being very practical, it obviously does not work on the real TTY. The first ...
3
votes
3answers
145 views

Shortening build command

Is there any way I can shorten this openCV build command? g++ file.cpp -o newFileName `pkg-config --cflags --libs opencv` I tried adding: -o newFileName `pkg-config --cflags --libs opencv` to an ...
0
votes
0answers
32 views

No such process error with launch ctl start. Mac OSX 10.9

The goal is to set the machine's network name with the IP address of this machine. I have created a plist file and put it into /library/launchagents/. For debugging reasons, I used the commandlaunctl ...
0
votes
2answers
48 views

How do I get the list of exit codes (and/or return codes) and meaning for a command/utility?

Is there a way I can do what stated in the title from the terminal commands, or will I have to look into the codes?
2
votes
1answer
66 views

How does one determine the amount of space allocated to their command line?

How would one go about determining the amount of space allocated to their system for command lines. Is there anything else I need to be concerned with?
0
votes
4answers
120 views

Can I have the shell ignore the command line sometimes but not always?

For debugging purpose sometimes I access a remote Linux box via VNC. At that time someone else may be working on that same Linux box through VNC and it may happen that I do not have facility to chat ...
63
votes
15answers
11k views

What are the legitimate uses of the `touch` command?

What's the point of the touch command? I know I can create empty files with it, but so is also the case with echo -n. Otherwise, why would someone need to change the timestamps of a file? Unless to ...
1
vote
1answer
50 views

AIX cifs hostname with underscore

I am trying to type this comand but for some reason it takes the first and not the second version. I have entered both the host names in the host file, FYI. This command works (hostname zq13c1): ...
4
votes
4answers
179 views

How to randomly sample a subset of a file

Is there any Linux command one can use to sample subset of a file? For instance, a file contains one million lines, and we want to randomly sample only one thousand lines from that file. For random ...
1
vote
1answer
56 views

Linux - How to open a console and display command results on startup?

I have a Linux server with a screen always displaying the end of a very usefull file. How could I automatically enter a shell and display the end of this file when the server starts? I'd like to do ...
1
vote
1answer
24 views

Mysql import the most recent file from a directory

I have a directory with daily backups of my entire MySQL database. I want to import the most recent backup into the database. I know to import a backup I need to use mysql -u root -ppasswordhere ...
4
votes
1answer
256 views

Which 2-letter POSIX command is different from all the others?

I was interviewed for an internship and I got the same question as this one: http://www.glassdoor.com/Interview/Which-2-letter-POSIX-command-is-different-from-all-the-others-QTN_498236.htm The ...
2
votes
3answers
251 views

What does “rm is hashed” mean?

I'm going through http://mywiki.wooledge.org/BashGuide/CommandsAndArguments and came across this: $ type rm rm is hashed (/bin/rm) $ type cd cd is a shell builtin Just a little earlier, the guide ...
7
votes
2answers
114 views

what is `env <command>` doing?

What is the command env ls -al doing? I had a Linux test and there was question: "How to run command directly, but not its alias?" I knew that there exists solution like prefixing command with some ...
4
votes
1answer
85 views

What does `init [2]` mean in the COMMAND column of ps?

Reading What do the brackets around processes mean? I understand that the executable name is printed. Linux ps man page: Sometimes the process args will be unavailable; when this happens, ps will ...
1
vote
2answers
77 views

Using globbing/wildcards when Opening Files from Terminal

I have a folder A. Inside the folder, there are some files a,b,c,d and there is a subfolder, B, containing files e,f,g. Suppose I want to open files a,b,c,d: then I just type xdg-open *. However, ...
3
votes
3answers
318 views

Correctly parse arguments in script behaving like a shell called through SSH

I have a server with a very limited used whom I want to be able to run two very specific (and custom) instructions through SSH. In order to do that, I have set the shell for that limited user to be a ...
2
votes
1answer
66 views

command not found handle doesn't work for url

I'm trying to setup the command_not_found_handle for URL links, %> command_not_found_handle() { echo "OK"; } %> aaaaa OK %> http://www.google.com bash: http://www.google.com: No such file or ...
3
votes
2answers
213 views

what is the meaning of this sed command?

sed -e 's/72;/72, next_val = 0x11111111;/;/@/{h;s/test/next/g;x;G}' fmt_vuln.c > fmt_vuln2.c could you tell me about what is the meaning of ;/@/{h;s/test/next/g;x;G}?
13
votes
1answer
488 views

What does yes $(yes yes) do?

Wondering what use the yes command might be, I stumbled upon this comment, and tried to execute yes $(yes yes) From what I understand, this should simply print out an infinite sequence of yes, but ...
3
votes
2answers
262 views

print command instead of echo in linux

I simply can print a message in terminal using linux echo command. prayag@prayag$ echo "prayag works on JVM" prayag works on JVM Can I have the same output with print command. I actually went ...
7
votes
3answers
245 views

Difference between sudo -i and sudo su [duplicate]

I was wondering what the difference is between sudo -i and sudo su?