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

learn more… | top users | synonyms (1)

2
votes
3answers
64 views

awk / sed / etc. concatenating colums in one file

I wonder what is a simpler way to do this: awk 'NR > 1 {print $1"\t"$2"\t"$3"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9$10$11$12$13$14$15$16}' file.in > file.out which is simply speaking " ...
0
votes
0answers
13 views

How to pass filepaths in text file as input to another FOR loop?

I am using C Shell. My current working xmlstarlet command: foreach xmlfile ( Test2/ResultReport1.xml Test3/ResultReport2.xml ) xmlstarlet sel -t -m '//RESULT_STEP' -v '@time_stamp' -o '|' -v '@...
4
votes
6answers
480 views

Command line method to find repeat-word typos, with line numbers

Updated: Clarify line number requirement, some verbosity reductions From the command line, is there a way to: check a file of English text to find repeat-word typos, along with line numbers where ...
2
votes
1answer
160 views

Unable to run chmod, chown, and even ls on a folder

I searched the net and tried to apply answers to similar problems but none worked so far. There is a folder named ocrpaylasim under /home/bnet path. This file belonged to bnet user before and was ...
1
vote
2answers
36 views

How to split a 6 or 7 GB file into several sub-2 GB files without splitting entry?

My level has 6 to 10 GB sized files as input. These files contain several lines of data. The next level's max input capacity is 2GB. So I have to split these 6-10 GB files into several sub-2 GB files ...
1
vote
0answers
1k views

Install Linux Mint 14 from CLI

I'm trying to install Linux Mint 14 from a live cd on a HP Pavilion laptop. I got some problem with X and the nvidia card, which prevents X from starting (and therefore prevents the live installer ...
0
votes
1answer
3k views

IBM V7000 scripts for monitoring

Hello (I'm no hard core coder:), I try to develop a script to do some very basic monitoring on an IBM SVC. My goal is to get some information about the nodes and my quroum status and then send ...
24
votes
4answers
15k views

how to download a file using just bash and nothing else (no curl, wget, perl, etc.)

I have a minimal headless *nix which does not have any command line utilities for downloading files (e.g. no curl, wget, etc). I only have bash. How can I download a file? Ideally, I would like a ...
14
votes
3answers
7k views

CalDAV command line client?

I'd like to do my CalDAV from the CLI just as I do my IMAP from mutt, what is my best bet as far as clients are concerned?
1
vote
3answers
48 views

How to combine two command outputs line by line? [duplicate]

let's say I have these two commands: $ cat file1 file1_a file1_b file1_c file1_d And: $ cat file2 file2_a file2_b file2_c file2_d How can I combine these outputs using a custom separator (e.g. .....
1
vote
1answer
25 views

bash kill process by call

I am using bash to start several instances of one python program, like this: python example.py -id $i where $i is the id given to the instance. All the processes are started on the same user, and ...
31
votes
2answers
112k views

Sending messages to another user

Is there any command to send messages through the Linux shell to other people on the same network? I'm using write user and then write the message itself. But there's any command that doesn't show my ...
15
votes
12answers
1k views

Bash script: split word on each letter

How can I split a word's letters, with each letter in a separate line? For example, given "StackOver" I would like to see S t a c k O v e r I'm new to bash so I have no clue where to start.
0
votes
1answer
525 views

nmcli connection activation failed

I was able to create a wifi hotspot on my debian 8 install using network tab under gnome settings. I was trying to do the same using nmcli but it always shows $nmcli con up id Hotspot Error: ...
0
votes
1answer
33 views

Network slowness [closed]

I am facing an issue in my project.We support an App which is hosted on a unix server. Partners try to access the same from many regions. Now some users in an region say "R" are complaining about ...
18
votes
9answers
86k views

How to boot Linux to command-line mode instead of GUI?

I am using 32-bit Red Hat Linux in my VM. I want to boot it to command-line mode, not to GUI mode. I know that from there I can switch to GUI mode using startx command. How do I switch back to command-...
31
votes
10answers
66k views

Converting multiple image files from JPEG to PDF format

I want to convert some files from jpeg to pdf. I am using following command. $ convert image1.jpg image1.pdf But I have 100 images. How should I convert all of them to corresponding pdfs? I ...
4
votes
5answers
72 views

terminal command | grep IP

ifconfig -a | grep 10.16 inet 10.16.x.xx netmask 0xffffff00 broadcast 10.16.x.xxx inet 10.16.x.xx netmask 0xffffff80 broadcast 10.16.x.xxx I have replaced the numbers with x My aim is to ...
6
votes
0answers
937 views

How to use terminal to access iCloud Drive when Finder is not running

I would like to access iCloud drive from Terminal in order to create an emergency backup. Unfortunately, my installation of Mac OS Yosemite is not operational, so I am using recovery mode to create my ...
20
votes
1answer
3k views

gvim -p limit of opened tabs?

When I run : gvim -p *.xyz I find that not all files are opened in tabs. It feels, like a kind of tab limit? But ! When I try to open unopened with : :tabnew it is opened next to previous ...
2
votes
2answers
375 views

Less command change color of “~” and “(END)”?

How do I change the color of the "~" characters that go along the edge of a Less command output. And how to change the color "(END)" at the bottom?
2
votes
5answers
8k views

how to find out the ip of an ssh HostName

Is there a simple way to retrieve the IP of a HostName from an ssh config on the command line? Many times I have to use scp and would like to connect to a machine, but I remember only the HostName.
1
vote
1answer
35 views

cat into stdin then pipe into program keeps forked shell open, why?

I'm not sure what's going on but I've been trying to understand what is happening with the input and output. So here is my program. #include <stdio.h> #include <stdlib.h> int main(){ ...
0
votes
2answers
56 views

How to execute a shell script from anywhere on my server?

So basically I have a JS app that is inside a directory in /var/lib/app/. To start this node app I execute a start script startapp.sh from inside the directory. Now I need it to start at boot time, ...
21
votes
5answers
9k views

command to layout tab separated list nicely

Sometimes, I'm getting as an input tab separated list, which is not quite aligned, for instance var1 var2 var3 var_with_long_name_which_ruins_alignment var2 var3 Is there an easy way to render ...
0
votes
0answers
10 views

when installing KODI, I get this error

Errors were encountered while processing: /var/cache/apt/archives/kodi_2%3a17.0~git20160721.0200-e1f73d5-0xenial_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1) i think its because ...
0
votes
0answers
8 views

How to use the man command to view documentation [duplicate]

I don't find man command to be much useful because I can't figure out what the flags are for and how all of them come together.
0
votes
0answers
16 views

Change location of executable [duplicate]

I wanted to install x264 cli encoder on OS X. I copied the downloaded binary to /usr/bin/, changed permissions and voila - it worked. Then I decided to be a smartass. So I deleted the file and ...
30
votes
4answers
26k views

What is the meaning of IFS=$'\n' in bash scripting?

At the beginning of a bash shell script is the following line: IFS=$'\n' What is the meaning behind this collection of symbols?
1
vote
2answers
45 views

Execute multiple ssh commands with different switch

I have a bash script for copying two files from a remote machine (that I cannot control), stored in a a path that needs root access. Here it is: ssh administrator@host "mkdir ${DIR}" ssh -t ...
3
votes
1answer
2k views

How to access u boot environment from linux?

How can I access and change the u-Boot env variables in linux. Using the u-boot/tools/env directory in u boot directory: u-boot$ make env Which created the executable file fw_printenv. I copied ...
3
votes
2answers
44 views

Protect session log from being written again by anyone

We have implemented a workaround to save command history in a new file for each user session for audit purpose. So each session file is identified by the start time and the username. The problem: The ...
0
votes
1answer
43 views

Undo last command possible? [duplicate]

In windows you can undo an operation if you press CTRL+Z. E.g. you delete a file in the gui then press CTRL+Z and the file will be restored and appears in the folder again. Is there something similar ...
0
votes
1answer
63 views

mv not working in script, but works fine on the commandline [on hold]

I am trying to put together a simple script that renames a few files and directories. If I type the entries directly on the commandline they work fine. But as soon as I put them in a script it doesnt ...
0
votes
1answer
45 views

sed works on commandline but not in script [closed]

Why does this work when I type it direct on the commandline: oldversion=12345 newversion=67890 sed -i "s/${oldversion}/${newversion}/g" "/home/user/MyDir_${newversion}/MyDir_${newversion}.reg" But ...
1
vote
1answer
51 views

Find files in a directory for two days i.e today's and Yesterday

I need a command or shell script to find files within a folder for today and yesterday in Linux. Example If I run the command today it should give me the list of files created today and also ...
10
votes
5answers
31k views

How to pass each line of a text file as an argument to a command?

I'm looking to write a script that takes a .txt filename as an argument, reads the file line by line, and passes each line to a command. For example, it runs command --option "LINE 1", then command --...
1
vote
0answers
45 views

Install torrent CLI on montaVista 6

I have been trying to figure this out for a while now but I have never made any progress with it. How can I install a torrent client on my NAS (Seagate Central) box which runs MontaVista 6. I have ...
1
vote
2answers
39 views

inaccessible directory

I git cloned into a directory "/source" before I mkdired it. It did not show up in its parent directory, but when I run the ls command, the output is indented like this: database static ...
1
vote
1answer
36 views

Something like $CDPATH that works for all bash commands

I'm trying to figure out if there's a way I can get $CDPATH working for every command-line tool. At the moment, I have a directory in my homedir that's called src/ which contains all of my projects. ...
2
votes
2answers
224 views

What is a Linux command that lists only USB storage devices?

I would like to list only the USB storage devices connected to my computer. Since these are SCSI disks, I used the command lsscsi, which lists the USB drives as well as my computer's hard drive and CD ...
7
votes
2answers
65 views

Display stdout and stderr in two separate streams

I'm looking for a way to visually separate stdout and stderr, so that they don't interleave and so that they can be easily identified. Ideally, stdout and stderr would have separate areas on the ...
18
votes
6answers
12k views

Make cd automatically ls

I find that I often do the following: %> cd bla/bla %> ls I would like it that whenever I cd into a directory it automatically does an ls. I fiddled with my .bashrc for a while, but couldn't ...
0
votes
1answer
24 views

Copy folders has specific part of name and it is content

I have a long list of folder as follow: 001_bat_3513 002_mon_3213 003_bat_3515 004_btt_3540 005_bat_4513 055_bpt_8523 056_bot_3513 058_bat_1513 . . From this list: How can I copy the folders ( and ...
3
votes
5answers
363 views

When I redirect the output of ls to a file, the filename is included in that file. How can I avoid this?

Observe: $ ls $ ls > list $ cat list list This appears to indicate that when ls is executed that the redirection into file list has already begun and the list file is already created. A fine ...
0
votes
1answer
56 views

ctrl-c unsets echo on terminal [closed]

On different Linux distributions I experienced that pressing ctrl-c to stop a program (like 'cmp') or completion causes the terminal (usually xterm or gnome-terminal) to not echo the input any more. ...
17
votes
5answers
67k views

How can I pass a command line argument into a shell script?

I know that shell scripts just run commands as if they were executed in at the command prompt. I'd like to be able to run shell scripts as if they were functions... That is, taking an input value or ...
-1
votes
2answers
52 views

How can I see the number of visitors in my website via CLI

How can I find out the number of visitors in real time in my website? I'd like to access to it via SSH, so it should be some CLI programs. In the worst case scenario I was thinking to analyse the ...
1
vote
2answers
50 views

Replace particular character but not if it is inside ()

I'm looking for a one-line command to make a file more readable. I want to replace all ; characters with newline unless it is inside a set of (). This is on a firewall, so I can only use bash; no ...
3
votes
1answer
26 views

Override an existing folder with cp

Is it possible to override an existing folder with cp? Example: tux@linux:~ $ cd /tmp/test/ tux@linux:/tmp/test $ mkdir A tux@linux:/tmp/test $ cd A tux@linux:/tmp/test/A $ touch 1 2 3 4 tux@linux:/...