One or a set of directives issued in the *nix environment to get information, change the state of something or to execute something. In other words: To gain an objective.

learn more… | top users | synonyms

-5
votes
0answers
17 views

How can i retrieve the following attributes in linux? [on hold]

Reads (transfers per second ) between system memory and user memory writes (transfers per second) between system memory and user memory Number of system calls of all types per second Number of ...
15
votes
2answers
793 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 ...
34
votes
2answers
15k views

How to run time on multiple commands AND write the time output to file?

I want to run time command to measure time of several commands. What I want to do is: Measure the time of running of all of them added together Write the time output to a file Write the STDERR from ...
0
votes
1answer
35 views

How to Move Large Number of Files to Original Directories?

I accidentally ran a command that moved the contents of all the subdirectories in my home folder to my home folder. Should I call it a loss and reinstall my system, or is there some command(s) I can ...
0
votes
4answers
65 views

bash : multiple command on one line with different exit code

I run a bash command from a c++ code using the system function provided in cstdlib. My question is not about the c++ implementation, but the one thing that is relevant to my question, is that I have ...
-1
votes
1answer
21 views

Statistics of System usage time (time of day, day of week)

I once found a tool that printed a huge amount of statistics about the time of day and day of week of computer usage when invoked. Unfortunately I don't remember the name neither did Google reveal it ...
1
vote
1answer
35 views

What is the difference between getty and agetty?

When I looked in the manual for agetty all I saw was alternative getty
2
votes
1answer
55 views

Something confusing about “su -” and “su” [duplicate]

I am studying the Linux command line. But the book which I'm reading says that su -l(-) username is starting a new shell session and loading the environment of the user I want to change to, but su ...
16
votes
8answers
29k views

Generate random numbers in specific range

After googling a bit I couldn't find a simple way to use a shell command to generate a random decimal integer number included in a specific range, that is between a minimum and a maximum. I read ...
0
votes
1answer
20 views

Execute custom command in Geany

I want to execute some command with currently edited file as argument from within Geany, triggered by keyboard shortcut. For example: I am editing /home/user/file.txt and after hitting "Ctrl+B" I ...
23
votes
4answers
5k views

The “yes” command

There is a yes command in unix/linux which basically infinitely prints y to the stdout. What is the point of it, and how is it useful?
0
votes
0answers
27 views

Is “<command> &” same as demonizing a process in Linux? [duplicate]

We all know that any command succeeded by ampersand (&) makes it run in the background. Can we use it instead of demonizing tools? For example: In order to run nodejs server, we use use packages ...
3
votes
2answers
62 views

How can I type a command to execute when the current command completes?

I have a function (not) that displays a notification. Hence, I can use it to show when a command is complete. sleep 5; not However, sometimes I forget to add ;not. In OS X's terminal (a few years ...
1
vote
3answers
53 views

Type and the speed of CPU using the lscpu command

I want to determine the type and speed of my CPU so I executed the CPU command, However, I have some confusion, so from my output I can't really determine what is my CPU type and my speed is 1600 ...
1
vote
1answer
58 views

how concatenate two commands?

Please can someone help me to concatenate two commands on shell, I'd have the path result and concatenate with the number of column in the first field. EX: #this gives me the path of my path ...
0
votes
1answer
16 views

Count the number of files with yesterday's date in ls's output

I would like to count the number of files with yesterday's date in ls's output. I tried: yday=$(date --date="yesterday" +"%b%Oe") ls . -ltr | grep $yday | wc -l The problem is that files have dates ...
5
votes
1answer
480 views

What exactly are commands? How to identify? [duplicate]

I want to know what exactly are Linux commands? & how to identify and locate them? In other words what are different kind/type/category of commands? How to identify them and locate (source) it.
2
votes
3answers
2k 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?
0
votes
2answers
33 views

Resource usage (% CPU) for given command on OS X

The time -v command outputs % CPU utilization for a given command on Linux. How do I do this on OS X? The Linux/OS X difference is illustrated here. I would like to measure multi-core utilization ...
0
votes
1answer
181 views

Downgrade Centos 7.2 to 7.1

I am currently using Centos 7.2.1511(check from file /etc/redhat-release) and trying to downgrade it to Centos 7.1.1503 (due to some package installation issue in centos 7.2) using the command yum ...
8
votes
2answers
10k views

Execute command in remote active terminal

Suppose you have a terminal emulator (T1) open with a PID of 6350. From another terminal, type this command (C1): echo "ls\n" > /proc/6350/fd/0 This writes ls and the new line in T1 but does ...
7
votes
7answers
542 views

How to rename splitfile[a-z] to splitfile[1-26]

I am trying to rename files named in the form of splitfile[a-z] to splitfile[1-26].csv, that is I want to rename splitfilea to splitfile1.csv and so on. I tried the following command: mv ...
30
votes
3answers
37k views

find - exec rm vs -delete

I'm trying to understand the difference between these two commands: sudo find / -name .DS_Store -delete and sudo find / -name ".DS_Store" -exec rm {} \; I noticed that the execmethod is ...
3
votes
1answer
92 views

ss - linux socket statistics utility output format

When using ss with -p option, user/pid/fd column jumps underneath the particular line. For instance this is it what I'm actually seeing: # ss -nulp4 State Recv-Q Send-Q ...
1
vote
2answers
500 views

How to find packages only which package name equal to text with aptitude?

When I want to search a package which named 'z', aptitude find packages which contains 'z' in package name same as 'like' in SQL, so aptitude find a lots of packages. How can I search packages which ...
5
votes
2answers
54 views

What does “is hashed” mean when using the type command? [duplicate]

I was reading this post and trying out all of the commands in the first answer... I don't really have anything else better to do right now. Anyways, I ran through them all in regards to rm. What ...
0
votes
1answer
24 views

Whatis command (shell builtin vs executable programs)

I know that whatis command is used to output a brief description about an executable program (Command). So both whatis cd whatis type Will print: nothing appropriate (Because from my ...
2
votes
1answer
40 views

Go to the directory where the executable command lives

This is a command-line trick from a book-"The Productive Programmer": pushd `which java`/.. The author says this command can temporarily go the directory where the executable command java lives. ...
1
vote
1answer
33 views

running commands from files [closed]

Let's say that I write some commands in a file let's say cmake although it doesn't need to be cmake run writing some commands in a text file. example filename: cmake_command cmake ...
-1
votes
1answer
25 views

What's the meaning of (1) in the man page? [duplicate]

With man bc, I have a line starting with bc(1). bc(1) bc(1) NAME bc - An arbitrary precision calculator language Some of ...
1
vote
1answer
50 views

How can I change lsblk to show model by default?

I'm currently running Arch. I simply want to change lsblk to always display as if the-o model was selected in addition to the standard options. I suppose I could rename lsblk and put a copy in the ...
92
votes
7answers
9k views

Why is cd not a program?

I've always wondered why cd isn't a program, but never managed to find the answer. Anyone know why this is the case?
2
votes
2answers
41 views

Run a command stored in a variable to echo into a file

How can I get the stored command to work for the following scenario: CMD='echo "test" >> test.txt' $CMD It will work for other scenarios like: CMD='mkdir test' $CMD
1
vote
2answers
32 views

URL instead of file in linux command parameters

Is there a way to put URL of a file instead of a file in parameters of a linux command? To be specific I am looking for a way to store dhcp.lease file remotely but dhcp accept just file. How can I do ...
20
votes
2answers
55k views

ifconfig command not found

I've just installed CentOS7 as a virtual machine on my mac (osx10.9.3 + virtualbox) .Running ifconfig returns command not found. Also running sudo /sbin/ifconfig returns commmand not found. I am root. ...
12
votes
3answers
6k views

Difference between sudo -i and sudo su [duplicate]

I was wondering what the difference is between sudo -i and sudo su?
15
votes
2answers
4k views

What's the difference between “realpath” and “readlink -f”

I've read a lot about realpath command and how it has been deprecated with the readlink -f being now recommended. I have also seen in some places that the reason why realpath was introduced was for ...
3
votes
3answers
4k views

How to permanently enable scl CentOS 6.4?

I installed a newer version of devtoolset (1.1) and was wondering how I would go about permanently setting these to be default. Right now, when I ssh into my server running CentOS, I have to run this ...
0
votes
3answers
52 views

How to get the Serial Number of a disk by corresponding file in linux?

I know that for a disk in linux, we can use commands such as hdparm or smartctl to get its basic information. But for the implementation of these commands, I think all of them are implemented by ...
-5
votes
1answer
502 views

Head and tail command

How can i do this exercise in unix? Create the following command: lshead.bash – list the first few lines of every file in a directory specified by the argument. This command should also allow options ...
3
votes
1answer
142 views

Is there a way to know how much memory Linux Os is using?

I am looking for a way to know the size of the memory that Linux os is using (I'm not worried about the other applications memory size). I am using Ubuntu distribution (Ubuntu 15.10). Thanks for your ...
0
votes
1answer
34 views

Unix addition script

Im currently trying to make a addition command in unix and have come up with the following code: #! /bin/bash #! Add - adds two given numbers together and displays the result "$num1" = $1 "$num2" = ...
1
vote
1answer
26 views

auditctl comm vs. exe

I was looking at Linux audit reports. Here is a log from ausearch. time->Mon Nov 23 12:30:30 2015 type=PROCTITLE msg=audit(1448281830.422:222556): proctitle=6D616E006175736561726368 ...
9
votes
5answers
1k views

Is there a practical use for the GNU factor command?

Looking through the GNU Coreutils, I spotted the factor command, that I had never noticed before. Reading the man page: Print the prime factors of each specified integer NUMBER. If none are ...
2
votes
1answer
2k views

When I run “sudo su” I get --bash: command not found for everything

I'm not good with command lines or servers. But I needed to configure for work a AMI of EC2 AWS with LINUX So I've installed a lot of stuff, moved a lot of stuff around and then I realized that sudo ...
0
votes
2answers
59 views

How to execute shell command produced using echo and sed?

I have tried doing: echo " mv /server/today/logfile1 /nfs/logs/ && gzip /nfs/logs/logfile1" | sed 's|logfile1|logfile2|g' It printed: mv /server/today/logfile2 /nfs/logs/ && gzip ...
0
votes
1answer
34 views

Use aliases as custom commands in terminator

I am using a terminator layout to start multiple terminals, and would like to call an alias at each terminal start which is defined in my .bash_aliases (called by both .bashrc and .profile). ...
0
votes
3answers
53 views

Apply a command to all subdirectories/files

In a parent directory, I have several sub-directories, each of them contain one or more space-delimited text files. I have the following command that outputs what I want, but only for an individual ...
0
votes
1answer
36 views

picocom -b 115200 - Why do you need to specify the baudrate?

I have an intel galileo board and if I try to connect to it from my laptop with: picocom /dev/ttyUSB0 I get just akward characters like: Terminal ready � ...
42
votes
3answers
18k 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?