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

learn more… | top users | synonyms (1)

1
vote
0answers
31 views

Why won't my python scripts run without the python command when moved from Windows to Linux? [duplicate]

I have some Python files that I wrote on my Windows PC and then sent over to a Linux machine using pscp. They work as intended on Windows, but when I try to execute them on the Linux machine, I always ...
2
votes
4answers
53 views

input file stream to command

How is it possible to send a file stream to this command instead of a file? /usr/local/bin/wkhtmltopdf --title "$SUBJECT" -q $SOURCEFILE $OUTPUTFILE The file stream is from a string in PHP.
0
votes
3answers
39 views

How to display only the last line of a listing ?

Supposed I make a listing and sort the files by its temporal attribute: ls -ltr -rwxrwxrwx 1 bla bla 4096 Feb 01 20:10 foo1 -rwxrwxrwx 1 bla bla 4096 Feb 01 20:12 foo2 . . . -rwxrwxrwx 1 bla bla ...
1
vote
0answers
7 views

Is it possible to make a key word search of all existing channels of all the irc networks from the command line ?

I am new to IRC (internet relay chat), as I understand it, an IRC network has a unique name like DALnet, is made of a chain of servers, a person can connect to one of them in order to connect to the ...
44
votes
5answers
65k views

ssh-add complains: Could not open a connection to your authentication agent

I've been trying to get ssh-add working on a RaspberryPi running Raspbian. I can start ssh-agent, when I do it gives the following output into the terminal: ...
0
votes
4answers
140 views

Applying different permissions to files vs. directories

Sunny answered the question above in this post, The answer was given as No need for scripts. // Directories: find . -type d -exec chmod XXX {} \; // Files: find . -type f -exec chmod ...
-3
votes
1answer
127 views
0
votes
1answer
205 views

How to find all JPG files on the file system when .jpg extension is not obligatory ? [duplicate]

First thing I noticed when switched from Windows to Linux was, that Linux has no strict naming convention and no obligatory file name extensions like .bmp, .jpg, .exe etc. Therefore I can not tell by ...
0
votes
1answer
237 views

What is the command-line equivalent to 'mintupdate' for Linux Mint?

Linux Mint has a nice GUI-based Update Manager with selectable update tiers. The defaults are for levels 1 through 3 our of a possible 5 levels. However, I often handle administrative tasks for a ...
2
votes
3answers
93 views

Difficulty converting from binary to hexadecimal using bc

I read how to calculate using the command line calculator and a HERE-document, but nevertheless I do not get what I expected and can not find my error, what I did in the shell was: bc << HERE ...
1
vote
2answers
765 views

An alternative to `xdotool type`

Is there an alternative to xdotool type "a string" It will be more useful if it is not an X11 app. Because X11 apps seem to be more vulnerable. Note: I will not use it in a terminal window. So ...
0
votes
1answer
45 views

Search a file for a string in multiple directories

Can someone please help me with a command to search a file for a string in multiple directories? I am searching for the VIP in httpd.conf in multiple httpd instances. I am using: find ./ -name ...
0
votes
0answers
38 views

Touch a file and give it an icon image via command line

Imagine this situation: for a given task, at some point of it, I should be able to create an empty file, which I can achieve by touch file.ext on the command line. However, if I touch a .jpg file, and ...
5
votes
3answers
263 views

How to put a newline special character into a file using the echo command and redirection operator?

I would like to create a file by using the echo command and the redirection operator, the file should be made of a few lines. I tried to include a newline by "\n" inside the string: echo "first ...
8
votes
10answers
6k views

linux diff tools: create list of modified files

How do I create a list of modified files programmatically using linux command line tools? I'm not interested in the difference in any particular file (delta, patch). I just want to have a list of new ...
1
vote
1answer
36 views

Only pipe on Success [duplicate]

Is there a way in the Linux command line, to only have a command pipe its output to another, when the command didn't fail? $ cmda | cmdb I would like it, so when cmda returns a status code other ...
0
votes
1answer
12 views

Makes it a difference whether I use a different -n flag value for xargs in combination with find command ?

Assume, someone searches for files that match some criteria using the find command and pipes the result into the rm command. find / -type f -name "*.jpg" | xargs rm First, I am not sure if the ...
1
vote
3answers
106 views

What is the reason for having numbers within the brackets of a function ? [duplicate]

I have seen on many occasions a name of a function (frankly speaking I just call it function because of it typical appearance, they are though sometimes named commands or system calls but I do not ...
3
votes
1answer
33 views

why does the output of xargs -n2 applied to the same number of arguments different whether piped or from keyboard?

when I execute xargs -n2, enter x x x x x and hit Enter, I get only 4 x back: $ xargs -n2 x x x x x x x x x But, when I pipe the x x x x x into the same command, I get the same amount of x back: ...
1
vote
1answer
59 views

Can not set the LC_TIME variable for the current process [duplicate]

On Linux Mint Rebecca, my current LC_TIME setting is LC_TIME="en_US.UTF-8" I would like to execute date and watch how the current date is displayed in a Chinese format with Chinese characters. ...
5
votes
2answers
10k views

executing if-statement from command prompt

In bash I can do the following: if [ -f /tmp/test.txt ]; then echo "true"; fi However, if I add sudo in front, it doesn't work anymore: sudo if [ -f /tmp/test.txt ]; then echo "true"; fi -bash: ...
-2
votes
0answers
23 views

Linux command inside C code: /* treat as comment? [migrated]

In C, I want to run linux command. Namely, int status; status=system("lftp ftp://192.168.1.1 -e "mget -E /2015/Date*/*Snap/*.csv"); The * above is wildcard matching. The C compiler thinks this is ...
4
votes
4answers
1k views

How to remove URI encoding from file names?

I realise this might be quite a simple question, but I'm still quite new to the command line and only have a grasp of basic commands. I've downloaded some lecture presentations (~25 or so) from my ...
1
vote
1answer
64 views

cat .bash_history | grep ./configure [closed]

Why does this not give any output: cat .bash_history | grep ./configure on an system/in an shell where ./configure has been run multiple times. And if I use the arrow key's to scroll the history in ...
9
votes
6answers
3k views

Displaying week's number in certain format using ncal or cal

Don't you just love it when two commands each do one thing you want but neither do both? This is what cal does. Nice formatting. Lacks week numbers though. $ cal January 2012 Su Mo Tu We ...
2
votes
1answer
728 views

List All Network Printers (including ones not installed)

It is easy to list the printers you've already installed with this command: lpstat -a However, this does not list network printers you have NOT installed. nmap will scan for all open ports on the ...
22
votes
8answers
82k views

How to connect to a serial port as simple as using SSH?

Is there a way to connect to a serial terminal just as you would do with SSH? There must be a simpler way than tools such as Minicom, like this $ serial /dev/ttyS0 I know I can cat the output ...
3
votes
2answers
68 views

How to list files on terminal so that we can see the file types such executable, ascii etc?

I have been trying to list files in directory using ls and passing it different options. Does it have the ability to list types of files as well ? I want to know which ones are executable , ...
12
votes
4answers
19k views

pdf to jpg without quality loss; gscan2pdf

When I convert a pdf file to bunch of jpg files using convert -quality 100 file.pdf page_%04d.jpg I have appreciable quality loss. However if I do the following, there is no (noticeable) quality ...
7
votes
4answers
4k views

Easy way to paste command line output to paste bin services?

Are there any command line tools on Linux that allow you to post output from commands or text files directly to a sharing service such as pastebin.com?
1
vote
1answer
35 views

How to configure the system in order beeing able to hear the sound of the \a escape character?

I read, that if I execute: echo -e "\a" a sound emerges, but frankly speaking, i executed this command several times and no sound happened.
0
votes
1answer
43 views

What is the logic behind the expression cat > foo << “wordofchoice” [duplicate]

I know the > and >> operators, > puts something into a file by deleting the old content, >> appends something onto the end of the file's content. When I only use cat > foo I am able to write ...
36
votes
8answers
82k views

How do I make my pc speaker beep

Using bash, how can I make the pc speaker beep? Something like echo 'beepsound' > /dev/pcspkr would be nice.
5
votes
3answers
3k 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 ...
1
vote
2answers
39 views

Open Firefox twice (with same profile)

There are tons of resources that tell how to run several instances of Firefox in parrallel. I can't find any that tells me how to configure a command (on a command line, start menu item, or panel ...
0
votes
0answers
31 views

Dropped connections with b43 driver using Broadcom BCM43228 wireless chip on Arch Linux

I managed to get my wireless working with the b43-firmware package in the AUR and for at least a month it worked perfectly. However, recently the internet connection has been dropping out. I'm ...
1
vote
1answer
23 views

How to determine the only additional file in otherwise two identical listings?

I have done a listing of the device folder two times, one time without the sd-card in the slot and one time inserted, the system automatically adds one file in the device folder. $ ls /dev | wc -l ...
1
vote
1answer
63 views

How to Prompt the user to press Enter to Exit in terminal so that the terminal doesn't close automatically?

Here is my Port.sh file echo 'Give me a maximum of 5 seconds to run please.' lsof -i | grep Xvnc | grep ESTABLISHED | grep $USER lsof -i | grep $USER | grep Xvnc | grep -o -P '(?<=:).*(?=->)' ...
0
votes
1answer
21 views

. as a command line argument to a command running in background

I run grep some-string -r . &. While it is running in bkg, I cd to another directory. It seems that grep interprets the hard link . differently then. What happens before and after I change the ...
3
votes
2answers
241 views
0
votes
1answer
2k views

Proper escaping of double quotations for curl post data?

I'm trying to test out a server, by sending it JSON data and reading the response. I need to POST data like {"item":"value with spaces"} but when I use curl I find that it sends the backslashes as ...
10
votes
6answers
45k views

How can I monitor all outgoing requests/connections from my machine?

My machine is a server so I want to ignore connections being made to my server (e.g. when someone visits my website). I want to see only connections/requests being made by my server to other places. ...
5
votes
2answers
203 views

How to count duplicated last columns without removing them?

I have a file that contains 4 columns. I want to compare the last three columns and count how many times they occur without deleting any of the lines. I just want the count to be present in front of ...
1
vote
2answers
41 views

Live resizing of an ext3 filesytem on CentOS6.5

I have a problem with my remote server hosted by my provider, I have only SSH access. The problem consist of getting this error file system rootfs has reached critical status that causes problems with ...
3
votes
1answer
58 views

rlwrap -z pipeto: piping output through pagers

I am using rlwrap to colorize prompt in asterisk CLI: rlwrap -s 99999 -a -pRED /usr/sbin/asterisk -r I read in man rlwrap that I can also use rlwrap -z pipeto to pipe output through a ...
2
votes
1answer
13k views

force rsync to overwrite files at destination even if they're newer

I have an rsync backup script I run, which also restores files back where they came from when I ask. But if the files at the destination are newer than those in the backup when I try to restore, it ...
1
vote
0answers
31 views

Printing to the terminal after boot

I am attempting to start a script that echos to the terminal once matchbox-terminal is loaded. I am able to run the script if I execute it in the existing xsession script located in ...
1
vote
1answer
55 views

awk with variables in condition and in output redirection file

I would please like some help with this command because I didn't find anything in documentation that can cover everything I want. I have some variables that are global, so I would prefer to keep them ...
20
votes
2answers
1k views

Is there a reason why ls does not have a --zero or -0 option

This question was prompted by questions about ls' -1 option and the recurring tendency of people to ask question and answers that includes processing the output of ls. This reuse of the output ls ...
2
votes
1answer
30 views

Is there a command that outputs ONLY the packages explicitly installed by the user? (ubuntu/debian)

I have tried searching for this but there seems to be no command that can output a list of packages (ideally in Ubuntu) that I have installed, not including any dependencies.