The command-line is the interactive interface to your shell.

learn more… | top users | synonyms (1)

0
votes
2answers
51 views

How to set Linux to ask for authentication when running potentially dangerous commands?

I've faced times when I accidentally ran dangerous commands and lost all my data. How do I set Linux to ask for current user password or root user password when running potentially dangerous commands ...
0
votes
2answers
42 views

file(1) command termination when using the -f - option

Say I'd like to use the file -f - command inside a script, and send some input using the stdin, when I'm finished I'd like to terminate it gracefully, but unfortunately I haven't found any way to do ...
0
votes
2answers
34 views

htop displays incorrectly on different vps

When I use "htop" command for linux (+F5), layout on 2 my vps different: Why on my first server I see broken tree?
4
votes
1answer
54 views

One liner for padding columns (similar to printf) of output from the previous pipe command?

I'd normally use printf to pad each cell with enough whitespace to maintain header position over its respective column. I'm wondering now, whether there's a way to do this on one line. I'm currently ...
1
vote
0answers
48 views

CLI network management

I've set up a console typewriter: a laptop with a minimal Debian install and no X server. I use it as a typewriter and I use wifi to sync my documents. I connect to wifi using wpa-supplicant. That ...
3
votes
1answer
82 views

What code runs when I type “sudo service nginx start”

I am having this problem: http://stackoverflow.com/questions/10939072/add-nginx-as-a-ubuntu-service-stop-and-reload-doesnt-work I am trying to understand if my code to start nginx is point to the ...
1
vote
1answer
71 views

Command works with tilde at the end. How?

I'm on Ubuntu. I have a script called myscripts in /usr/bin/myscripts This script simply changes the current directory to ~/Work/MyScripts Normally, I simply open a terminal and type ~/Desktop$ . ...
2
votes
4answers
42 views

Printing specific section of a line when a trigger value is present

I'm parsing data in the following format: prop1=value1:prop2=value2:prop3=value3+prop1=value4:prop2=value5 parts of the string are delimited by + properties can appear in any order the desired ...
2
votes
2answers
67 views

Custom help / man -like command (for reminders)

I often end up in a situation, where I don't use a command for a while, but then suddenly need to use it; and I need to wade through several help pages until constructing the command line I want. Case ...
0
votes
0answers
17 views

Is it possible to attach `kinit` to the first attempt to `ssh` without a Kerberos ticket?

My university uses Kerberos-based authentication for login to our unix servers. One way to get passwordless login is to run kinit, type my password, and then run ssh@host. For this setup, I do the ...
0
votes
0answers
27 views

What do the number in the file metadata mean [duplicate]

I typed ls -l in the terminal to get the file metadata of all files in the current folder What do the circled number : 1 & 2 represent in regard to the file metadata ???
1
vote
0answers
25 views

Set memory allocation for applications in Ubuntu [duplicate]

I have an application running under Ubuntu that tries to consume all available memory. Is there a way to specify and restrict the allocations available for a given application?
3
votes
1answer
98 views

bash command line editing (Emacs shortcuts)

When writing a command on the bash command line, I can use CTRL+w to delete a word backwards, or ALT+d to delete word forwards. The problem is, that these two shortcuts are not exactly complementary: ...
1
vote
0answers
31 views

List/query Open X11 Display Connections?

I am hitting this bug: NEWT errors when closing sketch on Linux · Issue #1651 · processing/processing · GitHub, when using Processing on Linux (Ubuntu 11.04); my messages are: X11Util.Display: ...
0
votes
0answers
26 views

Bluetooth profile info in linux

As Bluetooth device has a number of Bluetooth profiles. when want to do communication is Bluetooth device, first pair Bluetooth device and then starts sending data using Bluetooth. In Linux, ...
1
vote
1answer
74 views

Pass bash script arguments in double quotes to php cli script

I am trying to pass arguments to a bash script and then to a php script, I have literally looked at 30+ links, and tried over a dozen examples, and I for whatever reason have not been able to get the ...
1
vote
1answer
39 views

Loading input from a file in lex

First of all, I was not sure whether to post this question here or on stackoverflow, but here's my question anyway. Besides using input redirection, i.e. ./code < inputFile.dat, is there any way I ...
2
votes
1answer
40 views

How to change the color of all highlights in a PDF file?

I want to change the color of every highlight in a PDF file (without having it do for every highlight manually). Preferably with a command line command. Here is an example PDF with a highlighted ...
2
votes
3answers
55 views

Tar compress folder without specifying the filename

Is it possible to use tar to compress a folder without giving the filename of the archive to store in? Normally you use: tar -zcvf prog-1-jan-2005.tar.gz /home/jerry/prog I want to do something ...
1
vote
1answer
34 views

log into a machine through another, with (de)compression at the ends only [duplicate]

I have looked all around but couldn't find the answer to a very simply question: I would like to log into machine C from machine A, passing through machine B. However, B is slow, so I would also like ...
4
votes
3answers
65 views

Why does export -p exclude $_ variable?

As far I know, there are 3 ways to see exported variables: $ export -p | wc -l 50 $ env | wc -l 51 $ printenv | wc -l 51 As you can see, export -p misses single variable. It's a $_ one: $ diff ...
1
vote
1answer
290 views

Exit of “> ” mode in Unix shell

In sh (not Bash), how would we abort execution of command when the prompt is in > mode? For example, when entering a string with quotes only at the beginning, it makes the prompt look like >, ...
1
vote
7answers
133 views

what are some uses of .(single period) & ..(double period) in the shell command line

The single period . means current working directory The double period .. means parent of the current working directory I can only think of . being used in relative pathname etc cd ./bin/usr How are ...
20
votes
2answers
529 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
vote
1answer
64 views

Try to disable console output, console=null doesn't work

as mentioned above, I want to to completely turn off the console output, but putting console= or console=null in the kernel command line doesn't change a thing. When I enque quiet to the kernel ...
5
votes
2answers
142 views

Search/grep ftp remote filenames

I have already seen How to perform GREP on FTP? - that question implies that a grep in the remote file contents is needed; and as such, the answer is that the ftp protocol does not support that ...
1
vote
1answer
28 views

Adding pass completion to fish shell

I'm trying to get the CLI password manager pass to work in my fish shell with auto completion. I've already found the necessary file on GitHub, yet am having trouble finding out where to put it, or ...
-2
votes
2answers
28 views

I don't have writing access to a subdirectory in /

I have a server running under Debian wheezy. I want to create a directory in /. I can't without running sudo mkdir myDirectory. Once in /myDirectory, I can't write anything or create a repertory. I ...
2
votes
2answers
50 views

What is the bash syntax for extracting the values from multiple instances of the same argument?

I want to use multiple instances of command line paramater such as the -d option used by PHP for passing PHP options. I am currently using the getopts command in bash. With PHP invocation it would ...
0
votes
1answer
45 views

Custom command wget without response

I have an arduino with an ethernet shield that is controlling a relay, which control the lights. I usually just use the phone to send a http get request from a widget in tasker, but I would like to be ...
2
votes
0answers
53 views

Why does the kernel boot faster with less memory allocated?

This is not a important question, I'm just curious. Something strange happened, which isn't quiet clear to me: In the kernel command line, the amount of the memory can be set statically with the ...
3
votes
4answers
105 views

How to sort a list of files by time, given only the filenames

Given a list of file names, how can I sort it by file modification time? The resulting output needs to look exactly like the input with the exception that the data has been sorted accordingly. Here ...
2
votes
2answers
92 views

Command Line Photo Organiser Like Shotwell but to run on headless server

Does anyone know of a program (or even bash script) that can take photos from various folders and then consolidate them into one place and organise them into a directory structure by date in the way ...
1
vote
1answer
53 views

What is the Command to check the history of the command executed which should based on the user who accessed it [closed]

I am looking for the command or script to meet the following requirement. I wanted a history of all the users who connected to my machine and what commands they execute in there session and at which ...
2
votes
1answer
39 views

uname shows duplicate architecture

Why does uname show x86_64 three times? This is Ubuntu 12.04.4. $ uname -a Linux seedbox 3.2.0-59-generic #90-Ubuntu SMP Tue Jan 7 22:43:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
1
vote
0answers
39 views

Character encoding issue with my linux install?

I just installed Ubuntu 12.04.4 64 bits, all seemed to be ok, when I started to work on console I noticed: that I couldn't get some accented characters typed in to the console, for example, if I ...
3
votes
1answer
27 views

Script to dripfeed files

I need to write a script that will check a directory for a given file type, say *.mov, and move up to, say, 50GB worth into another directory. The purpose being that we have a huge bunch of files that ...
2
votes
1answer
43 views

Looking for a “undo” for file with holes (GNU)

Linux supports sparse files aka 'file with holes' Note following commands alias mystat='stat -c "%n: %B*%b blocks %s bytes"' dd if=/dev/zero bs=1024k seek=4096 count=0 of=file-with-holes ls -l ...
12
votes
6answers
633 views

Subtract 1 from all file names (rename them) in a directory.

I have a directory which contains image files with names like image1.jpg image2.jpg image3.jpg ... Unfortunately, the image names must be zero based, so image1.jpg should be image0.jpg, ...
0
votes
0answers
67 views

rsync multiple files to multiple directories

I need to move a large number of files that need to go to different directories i.e. file1.mpg to /mnt/s3/directory1/file1.mpg file2.mpg to /mnt/s3/directorya/file2.mpg file3.mpg to ...
0
votes
1answer
36 views

What is the reconnection policy of “persist” switch on “pon” command from pptp-linux package?

I use to establish a connection to my VPN PPTP server by typing: pon MyVPN persist I wanna know the reconnection timing details, but I have not found documentation enough about it. Specifically: ...
17
votes
2answers
598 views

^x^y unix trick for all instances in last command?

One of my favorite Unix tricks is ^x^y, which will take the last command and replace the first instance of "x" with "y". However, I'm wondering if a similar trick works to replace all instances of "x" ...
1
vote
1answer
102 views

usbhid can't find input interrupt endpoint

I have Scientific Linux 6.5 installed. From the beginning (on this computer) I constantly see this line jump in between all starting commands during the start up of the system (when I press esc to see ...
-1
votes
1answer
36 views

How to enable someone to SSH to my server from Windows? [closed]

I want someone from windows to log in into my server using SSH, so he can edit files and install things. Is there a step to step how to do it? I need to: Create his user account. Configure it, ...
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 ...
2
votes
1answer
83 views

When should you use subshells vs `xargs`?

Many simple commands using xargs could be rewritten as commands using subshells. For instance, here is something I was using earlier today, to concatenate the ten largest binaries in /usr/bin, written ...
25
votes
4answers
2k views

python vs bc in evaluating 6^6^6

I am evaluating the expression 6^6^6 using python and bc separately. The content of the python file is print 6**6**6. When I execute time python test.py, I get the output as real 0m0.067s ...
-2
votes
1answer
117 views

What is the difference between egrep, fgrep, find and grep commands? [duplicate]

i am new to linux console, however i know i can use grep to find files however i am wondering what the particular difference between these common commands ? They all seems to be equal in meaning to ...
2
votes
1answer
61 views

Start scrolling command prompt when filled until a particular fraction

I'm using the default terminal command prompt on Ubuntu 12.04. When I'm doing something on the prompt (as opposed to editing in VI) the scrolling starts when the text reaches bottom of the screen. I ...
2
votes
1answer
67 views

Copy files based on date/time from subset of directories

I'm teaching a class where (~80) students are submitting assignments that I can access via webdav, organized by student in directories named by their unique identifier. The students are split into ...