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
27 views

What does the command mv do? [on hold]

Which of the following things happen when using the command mv? has no impact on the inode table decrements the link count no data is moved places file data blocks on the free list deletes the old ...
0
votes
2answers
49 views

Linux command clarification

ls -l | grep -v '^d' | sort -g -r -k 5 | head -2: I used this command to write into a text file. I've researched a bit online and I think these commands mean this: grep: a search that searches for ...
-5
votes
0answers
21 views

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

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 ...
0
votes
1answer
37 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
68 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 ...
2
votes
1answer
56 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 ...
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 ...
1
vote
3answers
55 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 ...
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
1answer
59 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 ...
1
vote
1answer
37 views

What is the difference between getty and agetty?

When I looked in the manual for agetty all I saw was alternative getty
0
votes
1answer
203 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 ...
0
votes
1answer
22 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 ...
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 ...
0
votes
2answers
37 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 ...
7
votes
7answers
544 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 ...
3
votes
1answer
95 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 ...
5
votes
2answers
56 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
26 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 ...
2
votes
2answers
42 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 ...
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 ...
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 ...
-5
votes
1answer
531 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 ...
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 ...
0
votes
2answers
60 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
39 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
55 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 � ...
0
votes
1answer
41 views

how to save data in terminal as a spreadsheet file

I am a beginner to Linux. I am using this command bzgrep "1675391601497" ts3events.csv.bz2 | less which pulls up a bunch of data separated by commas. I would like to save them as a spreadsheet. what ...
1
vote
3answers
33 views

How to control pathing when executing a string command using bash -c?

Background, I am trying to use a Python library that spawns a subprocess using arguments ["bash", "-c", "python someScript.py"]. What's happening is Python 2.6 is executed, but I want python2.7 ...
1
vote
2answers
92 views

Why is a2p (Awk to Perl translator) installed by default? Why would I want to convert Awk to Perl? [closed]

I am surprised to see the a2p utility installed by default in my Linux distribution. a2p is a command line utility that converts an Awk program from standard input to a perl program that it outputs ...
0
votes
0answers
19 views

Piped sequence - printing

I need to write a piped sequence of commands that prints out a list of all sub directories of a current directory. In order to get all sub directories of a current directory I use: ls -D Since I am ...
0
votes
1answer
13 views

Are programs able to access read-only files?

For example, I am accessing a computer cluster through SSH, and I am running a Matlab program to take in data and then write to a text file. The problem is, the data is read only. So am I still able ...
7
votes
4answers
268 views

Execute a command where a file is found

How do I execute a command where a file is found? Consider I've an directory named testdir that contains the following: $ ls -R testdir/ testdir/: dir1 dir2 dir3 dir4 dir5 testdir/dir1: doc1.pdf ...
1
vote
2answers
28 views

which unix commands for monitoring disk operating are available?

To do some tests on SSD disk, I need to monitor operations such as number of reads and writes, access timestamp, which address accessed, write policy and so on. I know there is these commands: $ ...
0
votes
1answer
54 views

Pretty tricky cmd [duplicate]

I was searching for a cmd to generate random passwords, and got stuck on this one : echo `< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6` I've read the documentation of urandom, tr and head. But ...
22
votes
4answers
2k views

What causes a copy/paste in terminal to sometimes execute the command?

When you paste some command in terminal, it will sometimes automatically execute the command (just like if the "Enter" key was pressed), sometimes not. I've been using Linux for ages, pasted ...
1
vote
1answer
122 views

Unix command to convert character encoding in a .csv file

I need a Unix command to convert a .csv file that is in UNICODE format to ANSI format. The file is imported from the Cognos environment and I am unable to make any changes with the format in cognos ...
2
votes
3answers
38 views

need to move files with name into directories with corresponding names

I have files named patient_sample_L001_R1_001, patient_sample_L002_R1_001, patient_sample_L003_R1_001, patient_sample_L004_R1_001 another set named patient_sample_L001_R1_002, ...
1
vote
0answers
34 views

How to determine all files that were created by a command

I want to know what files were created during execution of some shell command.
0
votes
2answers
41 views

How can I get the size of an application after it was already installed?

With the command whereis I can get the location of the files but instead summing all the sizes of those files I would like to know if there is simpler way to do this.
12
votes
5answers
881 views

How to recall a previous command (without execution) in order to change it?

I can't remember the trick where I could get the last command without running it: let's say I want to be be able to access the command !1255 when pressing the up arrow key and modify the command. So ...
4
votes
1answer
132 views

How to join series of file together side by side without seeing any gap between columns in output?

How can I join several files together in way that there not be any gap between columns in final out put? as an example if following be two inputs: input1.txt 22211 21111 11111 22222 22222 11111 ...