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

learn more… | top users | synonyms (1)

0
votes
1answer
51 views

Shell script - creating and assign to groups advice needed on my script

Where could I include man useradd and -g and G i'm not sure where to include these commands above. The current shell script doesn't successly create the user but does run. #!/usr/bin/env bash ...
2
votes
1answer
27 views

Insert string or line after last instance of a specific search variable, in a loop

I'm wondering if someone could help me with a specific coding question. I have a DNA sequencing file that reads something like this (as an example): ...
-9
votes
1answer
48 views

Unix “ls” command? [closed]

Can someone explain to me what are all the options available with the -la flags for the ls command ? I have read the man pages, but still not sure.
3
votes
2answers
70 views

Modify Openbox key-bindings from commandline

I am using the LXDE desktop environment, which is based on Openbox. I know how to change the key-bindings by editing my ~/.config/openbox/lxde-rc.xml, e.g.: <keybind key="A-F11"> <action ...
1
vote
0answers
34 views

Find list items in other file [duplicate]

I have one file with hundreds of unique IP addresses (each on a separate line) from which a bot tries to login to one of our services. I would like to see which of these addresses appear in another ...
-1
votes
4answers
34 views

How can I address the path/file I just specified again? [duplicate]

Say I'll start writing sudo cp /etc/var/more/evenMORE/fileABC and as the target of the copying, I'd like to define the same folder, except just a different filename (whether it is a new name like ...
41
votes
8answers
20k views

diff within a line

I have some sql dumps that I am looking at the differences between. diff can obviously show me the difference between two lines, but I'm driving myself nuts trying to find which values in the long ...
29
votes
6answers
9k views

Single dashes `-` for single-character options, but double dashes `--` for words?

Where did the convention of using single dashes for letters and doubles dashes for words come from and why is continued to be used? For example if I type in ls --help, you see: -a, --all ...
1
vote
1answer
47 views

Is bash command line interpreter implemented on emacs?

I'm investigating the relationship between bash and emacs shorcuts. Someone told me that the reason why they're similar is that bash uses emacs as its command line interpreter. However, I haven't ...
0
votes
1answer
34 views

How can I access the history buffer in sh? (not in Bash)

Is there a command history in sh, for example how to access it, and as well, how to ensure it is clear? To clarify shells here: let's say you've logged on to a non-Gui Linux system, and $SHELL is ...
1
vote
2answers
89 views

Command to simulate keyboard input

Is there a command that exists that can simulate keypresses? I want to pipe some data to it to make it type into a GUI program for me.
1
vote
2answers
32 views

Search for processes which are CPU consumming

I can track the process launched by the user4 with awk: ps aux | awk '$1~/user4/' And also to track what process consume more than 10% CPU: ps aux | awk '$3> 10' Hoe the question is not too ...
7
votes
1answer
5k views

Zip the contents of a folder without including the folder itself

I have a directory called folder that looks like this: folder -> root_folder -> some files I want to zip this directory into zipped_dir, I tried: zip -r ...
21
votes
7answers
5k views

Command-line-friendly full-text indexing?

Is there such a thing as a full-text indexing engine, that can be queried from the command line and ideally wouldn't require using a gui at all ? I'm especially interested in indexing my ebooks and ...
0
votes
5answers
54 views

Remove the latest modified file

I have created two files: sample.txt and sample.txt  (the second file contains some hidden characters, e.g. a space). How can I remove the latest modified file? I'm using Linux.
0
votes
2answers
53 views

why is btmp not showing the username of logged in users?

I am trying to compare the output of the btmp file and who -a commands. I don't know why, but btmp file currently is not showing the username but its showing UNKNOWN in the username field. I am ...
0
votes
1answer
36 views

How to force an application to use a specific cpu? [duplicate]

For example : To build a kernel we can use make it will take more than one hour , to accelerate the process we can use make -j4 all this may finish almost four times as quickly. Generally : How to ...
163
votes
3answers
43k views

What does “--” (double-dash) mean? (also known as “bare double dash”)

I have seen -- used in the compgen command. For example: compgen -W "foo bar baz" -- b What is the meaning of the --.
5
votes
3answers
592 views

Remove file, but only if it's a symlink

Ideally I'd like a command like this rm --only-if-symlink link-to-file because I have burned myself too many times accidentally deleting the file instead of the symlink pointing to the file. This ...
1
vote
1answer
38 views

“time > time.txt” refuses to work propely

I just started learning Linux commands. I was experimenting with the > command, that, as far as I understand, makes the command before it write it's output to the file after the sign. This ...
1
vote
1answer
26 views

Is there a program that will launch a configurable context menu

I'm looking for something like Zenity or Yad, except I want something that behaves like a menu, namely: it opens right next to the cursor; it takes one click to select things; it's possible to have ...
3
votes
2answers
49 views

On applying commands to groups of lines from stdin

The Unix package datamash supports the application of several summarizing operations to groups of input lines. For example1, here datamash is used to compute the sums of column 2 for each value in ...
1
vote
1answer
88 views

Is there a way to change KDE4 display settings from the command line?

Consider the following setup: My laptop is normally located at my desk connected to power, external keyboard and mouse and an external monitor. Since the laptop's screen is pretty small and my monitor ...
1
vote
4answers
11k views

Telnet on Linux Server

I want to know if it is necessary to have telnet enabled on both sides of machines to get telnet connection. Here's the issue: I am trying to telnet some public IP on port 80 from a Linux web server ...
0
votes
2answers
82 views

Linux server terminal - rows of tildes, can't write commands?

I'm pretty new - came across this problem. My webserver terminal is looking weird, there are some code echoes and then rows and rows of tilde. Where I type would be at the green square, but nothing I ...
3
votes
2answers
8k views

List of available command options?

I'm currently setting up my first web server without a control panel and so far things are going pretty good! I was just wondering if anyone could direct me to somewhere that explains all of the ...
0
votes
1answer
33 views

Unable to detach a USB device on Ubuntu 14.04

I was using udisks to unmount and detach usb device with following commands which works just fine on Ubuntu 10.04 udisks --unmount /dev/sdb1 udisks --detach /dev/sdb Because udisks is not available ...
4
votes
5answers
4k views

Pipe the output of a command to rm command

Following command prints the path of the song being played. mpc | head -n 1 songs/oldSongs/Mukesh_D/041 KANHAIYA = YAAD AAYI ADHI RAAT KO.mp3 Can I delete this file by modifying the command I used ...
3
votes
1answer
86 views

What Command Line tools to connect from Unix to remote Windows?

I need to make some scripts for connecting from a Unix server to several Windows stations for automating file transfers. GUI is not needed and I can't install any additional software into Windows ...
0
votes
4answers
642 views

Unix grep confusion

I am doing an assignment for school and using putty to complete the assignment. The format of the assignment does not allow for much variation and thus only one answer is sufficient enough to allow me ...
9
votes
2answers
12k views

Creating a messagebox using commandline

How can I create a message box using command-line to show a text‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌?
2
votes
2answers
200 views

Getting Public IP address of EC2 instance from outside using AWS-cli [closed]

I am trying to make use of Amazon's elasticity and bring instances online and off using the AWS cli. But as you know, every time you offline a system, and bring it back to life, it comes with a new IP ...
0
votes
0answers
22 views

How to recover content of the file in unix? [duplicate]

I accidentally gave cat >filename instead of cat filename and my content is lost.Now I have only my file,but content is deleted.How to recover the content alone? Please help me to get back the ...
3
votes
3answers
504 views

BASH: �ls: command not found when typing 'ñ' by mistake

When I erroneously type 'ñ' (expecting to type any command) and then remove it and type the correct letter, the output returns the command with a special character attached �, obviously the shell ...
0
votes
1answer
38 views

Unix, create file based on command [duplicate]

I have a command, but I want to get the results into a .txt file I can open. How do I alter my command to allow the results to be put into a text file. I plan to transfer this .txt file to my local ...
1
vote
0answers
21 views

How to connect to wifi using nmcli with a static IP address and password?

There is info on how to connect to ethernet(eth0) with nmcli using a static IP, but nothing on how to connect to wifi (wlan0)? This sets up a connection profile but how to add the password and ...
147
votes
8answers
243k views

How do I get the size of a directory on the command line?

I tried to obtain the size of a folder (containing folders and sub folders) by using the ls command with option l. It seems to work for files (ls -l file name), but if I try to get the size of a ...
1
vote
2answers
51 views

Retrieve name of the active network interface only [duplicate]

How can I retrieve from the command line (or a shell script) only the name of the active network interface, in Linux? If there are several active interfaces, I want just one (selected arbitrarily).
3
votes
1answer
33 views

Argument list too long when running ls -d “$PWD”/* command

I'm trying to execute ls -d "$PWD"/* > formmlFileList43k.list But I get the following error: bash: /bin/ls: Argument list too long I've read using a pipe won't have such limitation, how can I ...
16
votes
4answers
30k views

How can I kill a particular thread of a process?

$ ps -e -T | grep myp | grep -v grep 797 797 ? 00:00:00 myp 797 798 ? 00:00:00 myp 797 799 ? 00:00:00 myp 797 800 ? 00:00:00 myp This shows the process ...
0
votes
2answers
36 views

How to pick a random element from the output of a command?

if I have sth. like echo 1 2 3 4 5 6 or echo man woman child what do I have to put behind the pipe to pick out one element of 1 2 3 4 5 6 or man woman child ? echo 1 2 3 4 5 6 | command 3
0
votes
2answers
22 views

how would I convert this interface block into a command

I tried this: ifconfig br0 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0 network 192.168.0.0 gateway 192.168.0.1 up But it did not work I am trying to use all of these parameters: ...
0
votes
2answers
54 views

How do I find a range of numbers in the content of file and move files containing the range of numbers to another directory?

Okay so I have about 90 files, each with a body like 187942 78.9 I want to filter files that has the values between 70 to 90 on the second column and move them to another directory. I'm ...
0
votes
0answers
32 views

How to split a A4 Letter page pdf into 2 4x6 pdfs

I get pdfs in A4 Letter size in portrait orientation, they have 2 sections top and bottom each 4x6. Right side of pdf is blank. I need to spit them into 2 pdfs 4x6 or 2 pages of the same pdf.. Ive ...
13
votes
4answers
118k views

How do I exit or cancel a bad bash command?

I expect to get some flak for this, but I can't find the answer anywhere. It seems like it should be so obvious. Sometimes, when I type a bad command in a bash terminal, the cursor just jumps down to ...
9
votes
2answers
5k views

How can I use ms-dos style wildcards with ls and mv?

I have the misfortune of coming from a MS-DOS background - but at least it makes me appreciate how much more powerful Linux is. I've been working on getting my Linux-Fu up to par, but there are a ...
1
vote
1answer
28 views

Packages and the like for configuring new systems [closed]

I'm faced with the prospect of moving from a server which has been configured previously with loads and loads of the sorts of tools you forget about day-to-day as you do various tasks (I'm talking ...
22
votes
8answers
1k views

Clipboard for copying and pasting files in command line?

In Bash, suppose I visit a directory, and then another directory. I would like to copy a file from the first directory to the second directory, but without specifying the long pathnames of them. Is it ...
0
votes
1answer
52 views

Downloading an attachment from Inbox using the command-line

Please help me figure out the right program to use to solve the following: Everyday I have a report emailed as a PDF attachment to my inbox. The subject is the same, and it is from the same email ...