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

1
vote
1answer
16 views

How do I abort fc without executing the command?

The command fc will allow visual editing of the previous command. If I change my mind in the editor, how do I stop the command from being executed. In vi, typing q! or q both result in the command ...
-4
votes
0answers
37 views

small help in this qustion [on hold]

I tried many time with [username]=Foxr \$. But gives error. Q: Provide an instruction to alter your prompt so that it displays the following information: (time : instruction number) [username] ...
-1
votes
2answers
3k views

Sorting by size

When I run ls | sort -S I get sort : option requires an argument -- ´S´ Why I cant sort the list of my files with the sort option by size? I know that I can use only the ls command alone. ...
11
votes
5answers
15k views

Generate random numbers in specific range

After googling a bit I couldn't find a simple way to generate with a shell command a random number included in a specific range, between a minimum and a maximum. I read about /dev/random, ...
-1
votes
2answers
83 views

Is There any unix command that does not make any system call while executing

I have been wondering if there is any unix command that does not make any system call. For example if we take into instance ls it also uses a lot of system calls, like open, read, write. We use ...
0
votes
1answer
13 views

What is the recommended resource to refer to for syntax, usage and information about commands for an application?

What is the recommended resource to refer to for syntax, usage and information about commands for an application? I am currently trying to decide between command help (assuming that command has a ...
0
votes
1answer
679 views

Running program on startup (Fedora 22/ 2015)

I tried really hard to avoid posting a new question for something so basic and already answered in a hundred places, but after spending two hours on this and trying every solution out there I'm ...
1
vote
1answer
97 views

How can I find out the IP address from which a user logged in?

We have two RHEL 6.4 64-bit boxes in our environment. They are accessed remotely via putty. The password of user ABC on one RHEL box is shared by multiple users. User ABC logged into server from ...
1
vote
1answer
43 views

error ./c.sh: line 24: [: too many arguments in shell program

I am trying to make a shell script to print the amount of time user was logged into the system but I encountered a too many arguments error. I tried many methods from the internet but none worked. ...
0
votes
1answer
39 views

How do I run a batch file at a specific time?

I have tried using the batch and at commands with no luck. I have a batch file in a location, lets say "$DD/batchfile.batch". Here is what I have tried. batch -f $DD/batchfile.batch 10:00 today at -f ...
0
votes
2answers
103 views

What is the alternative for ls command in linux? [duplicate]

How can I list the current directory or any directory path contents without using ls command? Can we do it using echo command?
19
votes
3answers
490 views

The precedence of command options?

I know that rm -f file1 will forcefully remove file1 without prompting me. I also know that rm -i file1 will first prompt me before removing file1 Now if you execute rm -if file1, this will also ...
1
vote
3answers
9k views

tar: Unexpected EOF in archive

I am trying extract .tar.gz file it but with no luck gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now the ...
1
vote
4answers
734 views

List all commands that a shell knows

What can I type at my shell (which happens to be bash) that will list all the commands that are recognized? Also, does this differ by shell? Or do all shells just have a "directory" of commands they ...
9
votes
2answers
3k views

What's the difference between “dir” and “ls”?

I have compared the man pages of dir and ls and they seem to be exactly the same. Both are part of GNU coreutils and "list directory contents". The only difference I've seen so far is that dir ...
19
votes
3answers
3k 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 ...
8
votes
3answers
14k 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 ...
0
votes
3answers
35 views

How to delete files from a directory based on the contents of a gzipped tar file?

Given that I: have a directory that contains over 1000 files have a gzip'ed tar file that contains a subset of those files (x.tgz) What is the single command line (if it is possible) that will ...
1
vote
2answers
29 views

How do i have my script execute one more command after a previous command returns a non-zero value before it is aborted?

I have a shell script that calls on a Perl script to do some file processing. The Perl scripts exits with either a zero or one value. I have the Unix set -e command at the beginning of my script to ...
2
votes
1answer
118 views

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

I'm not good with command lines nor 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 ...
1
vote
4answers
199 views

change last 10 characters of the base (not extension) of multiple files

I have many files of different lengths but the same extension and I have tried many commands to rename all of them at once. Is it possible to change only the last 10 characters of the base of all ...
1
vote
0answers
24 views

tmux select-pane -LDUR command - disable auto-cycling behavior

is it possible to disable the behavior which cause selecting a pane on opposite side of a tmux window if there is no more pane left in a direction select-pane command was originally triggered at? if ...
2
votes
1answer
77 views

How prevent users from running commands via dot slash for a directory?

Does anyone know if it is possible to restrict execution of commands via dot slash notation for a directory? The environment is bash on Linux. For example, I have a directory /usr/local/app/bin. In ...
0
votes
1answer
41 views

Unable to execute batch remote commands after pkill command

We've a scenario where I'm executing various remote commands at once like the following: ssh user@remote-ip " ps -A | grep java rm -rf /usr/share/tomcat/webapps/ROOT ls " The above set ...
5
votes
1answer
436 views

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

I want to know what exactly are Linux commands? & how to identify and locate them? (Say Introduce the "commands") In other words what are different kind/type/category of commands? How to identify ...
37
votes
3answers
13k 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?
2
votes
1answer
61 views

What does blkid stand for?

What does the command blkid stand for? I want a way to remember it. Also, what is it often used for?
88
votes
7answers
8k 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?
0
votes
1answer
39 views

Creating an symbolic link in /bin automatically creates a second link in /usr/bin and the which command chooses /usr/bin

I just created an executable: ln -s /path/to/script.sh /bin/script then I check if everything succeeds and it does(/bin/script is created) but this has also created: /usr/bin/script and if I ...
2
votes
2answers
192 views

How do you add a bash script to your PATH variable using symlinks?

I run a gaming server called PocketMine. So basically I have a folder in my home directory that has a bash script to run the server: ~/PocketMine/start.sh Everytime I want to run the server I either ...
0
votes
1answer
47 views

list users who are all created by current user in linux

I have set of users with root access.I want to know list of users who are all created by currently logged in user. From below structure if user1 login to system , how to list user's like ...
3
votes
3answers
61 views

Quick change directory to a similar directory structure?

In the test environment, we have a directory structure for log files that looks like this: /var/Logs/int/app-id/region-code/log/file-name.log /var/Logs/sat/app-id/region-code/log/file-name.log ...
0
votes
3answers
201 views

Can a command be executed without a shell?

I am developing a binary executable program command to execute programs and return the output into a text field. The parameters to the command involve the command itself as it would be typed on the ...
2
votes
2answers
1k 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 ...
18
votes
3answers
3k 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
1answer
70 views

What does this ls command do? [duplicate]

what does this command do if it was executed in my current working directory that has files in it? ls 2> result I think whatever ls writes will be redirected to the result file? Is that correct and ...
11
votes
3answers
7k views

What is the purpose of -e in sed command?

I can't find any documentation about the sed -e switch, for simple replace, do I need it? e.g. sed 's/foo/bar/' VS sed -e 's/foo/bar/'
0
votes
2answers
136 views

“date -d” command fails on Docker Alpine Linux container

I built Alpine Linux in a Docker container with the following Dockerfile: FROM alpine:3.2 RUN apk add --update jq curl && rm -rf /var/cache/apk/* the build run successfully: $ docker build ...
10
votes
1answer
29k 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. ...
0
votes
1answer
34 views

What's the inverse of the X mnemonic in chmod?

Is there a way other than find … -type f -exec chmod -x {} + to remove the x bit from u, g and/or o recursively with just chmod? The X mnemonic in chmod allows one to recursively set permissions on a ...
0
votes
4answers
152 views

Remove first 2 columns from first row of a file

I am looking for a command to remove first 2 columns from the first row of a file. The delimiter for the columns is a pipe. Number of columns vary. we just need to blindly remove first 2 columns. ...
0
votes
1answer
18 views

run remote command to save debian package list

I'd like to backup the package list(dpkg) of some remote computers to a backup server: all of them running Debian. I already configured the rsa key to login remotely as root on the other computers ...
1
vote
3answers
120 views

List of files where the line count is greater than 2

Bunch of files exist in a directory. Some files have 1 line in it, some files have more number of lines. I'm trying to display filenames from a particular directory(with full path), where the ...
3
votes
2answers
165 views

Convert all non-JPG images to JPGs

What command can I use to convert all images in a folder which are not JPGs (PNG and BMP primarily) to JPG? I'd also like the conversion quality to be 100%. And I'd like the converted images to ...
0
votes
0answers
33 views

Failed to execute the iscsiadm commands

When I am using the command: iscsiadm -m discoverydb -t st -p 10.10.11.12:3260 -I be2iscsi.00:17:a4:7a:e3:34.ipv4.0 --discover -P 1 I am getting below error: scsi host1: BC_207 : MBX Cmd Failed ...
2
votes
1answer
95 views

Failed in execute of “lsscsi” command [closed]

I can't execute the "lsscsi" command in linux, I keep getting "command not found" when I try to run it. How can I solve this issue?
1
vote
2answers
2k views

What is difference between pbrun and sudo command?

What is difference between pbrun and sudo command? I have seen people executing pbrun sudo su - what this means? I know su -, it will try to switch to root user. What speciality pbrun gives to sudo ...
0
votes
0answers
48 views

How to manage any command access privileges on debian linux

I am using Debian 7, and my desktop is xfce. I want to achieve managing any command on Linux. For example, executing /usr/bin/xfce4-taskmanager command would not require sudo privileges so any user ...
4
votes
1answer
530 views

ZIP files with size limit

Is there a command to create multiple ZIP files based on file size? So that in a folder of 600 files, totalling 1 GB, the command will create 4 zips roughly equal to 250mb. There's a similar command ...
8
votes
2answers
555 views

Finding a file type assuming wrong extension

I have an image archive I keep up. Sometimes, the sites I pull them from reformat the file while keeping the extension the same, most often making PNG images into JPG's that are still named ".png". ...