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.
6
votes
2answers
211 views
Change the order of executables started in bash
If I execute the test command in bash, test(evaluates conditional expression) built-in utility is started:
$ type test
test is a shell builtin
$ type -a test
test is a shell builtin
test is ...
5
votes
1answer
362 views
What exactly are commands? How to identify? [duplicate]
I want to know what exactly are Linux commands? & how to identify and locate them?
6
votes
4answers
115 views
Is there a tool for summarizing what all commands do?
So I understand that there are man pages for getting the documentation when the internet is unavailable, or when you need advanced uses, but what if I'm offline and I don't even know what tool I need ...
2
votes
2answers
59 views
Tool for viewing top N items in stream
I'm looking for an existing Linux command-line tools that can accomplish the following:
Consider there is an input stream /dev/inputstream which spews an infinite stream of data that looks like this:
...
1
vote
1answer
30 views
How to convert .doc to ODF with a command line?
I'd like to convert many Microsoft Word documents to ODF (the OO.org formata with a command line (because there are many of them).
(I need them for reading afterwards on a device where reading OO.org ...
0
votes
0answers
36 views
Pbrun not allowing to execute commands
why do i get this when i execute pbrun.
$ pbrun ls
You are NOT allowed to use pbrun -h <remotehost> ls.
Please try again without -h option.
Host: xxxx
Submithost: xxxx.abcd.xyz.com
...
3
votes
2answers
195 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
233 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 ...
1
vote
1answer
48 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 ...
79
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 ...
-3
votes
1answer
38 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?
11
votes
7answers
2k views
1
vote
2answers
13 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 $* ...
1
vote
1answer
34 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 ...
0
votes
1answer
28 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
26 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}$" | ...
15
votes
2answers
481 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
23 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
50 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
104 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).
...
0
votes
3answers
62 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
293 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
563 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
54 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
52 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
146 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
80 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
157 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 ...
0
votes
0answers
38 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 ...
3
votes
3answers
226 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
2answers
61 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
68 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
126 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 ...
1
vote
1answer
73 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):
...
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 ...
4
votes
4answers
306 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
68 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
30 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
280 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 ...
5
votes
3answers
415 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
125 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 ...
1
vote
1answer
153 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 ...
4
votes
1answer
98 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 ...
3
votes
3answers
388 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
84 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 ...
1
vote
2answers
87 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
2answers
222 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
506 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 ...