0
votes
1answer
10 views

sending argument to vim using grep

I saw this question but I couldn't implement what I'm looking for.Here is what I want:I have a file with a few lines ending with 4.1.01.97 (same number for all lines - but number can change from ...
0
votes
1answer
14 views

how to echo text into a file from the CLI to ammend a variable in the file?

using Centos7e.gvi test.txt test.txt contains the following informationx=100y=200z=300I want to put a command into the CLI such as echo x=250 >> test.txt but instead of x=250 being ...
0
votes
1answer
47 views

mv within shell script does not move files

Often discussed, yet the answers did not get me to a solution unfortunately, and I am a bit ashamed that I need to ask this question again. But, here we are.I have a shell script dosomething.sh with ...
0
votes
3answers
48 views

How do I make a command to refresh itself without writing a .sh script?

I'm doing that command to measure RAM usage:while sleep 1; do free && echo -e && ps -eo rss | awk '{sum+=$1} END {print sum}' && echo -e "\n"; doneHowever, it still keeps ...
2
votes
3answers
39 views

How can I add text to a file in front of a specific word from the Linux command line?

I'm currently writing a script that automatically changes a configuration file, specifically, I want to put "vfio vfio_iommu_type1 vfio_pci vfio_virqfd" (without the quotation marks)between the ...
17
votes
3answers
4k views

Quickest way to wipe an SSD clean of all its partitions for repartitioning in Linux?

I want to wipe an SSD clean of all its partitions and data, so I can repartition it (this is not for security purposes).I've looked at sudo dd if=/dev/zero of=/dev/sdb bs=1M but if this just fills ...
0
votes
1answer
30 views

Bash script that itself generates bash commands

If this command is entered while a song is playing in Audacious:songdir=$(echo -n $(audtool current-song-filename) | cut -d'/' -f-5);for entry in "$songdir"/*.mp3; do echo "$entry";doneThe command ...
0
votes
0answers
4 views

How to test internet speed using terminal emulator on Android [migrated]

I have Termux app installed on my Android phone. Is there a speed test tool that I can install and use from the command line? I have tried speedtest-cli, installed it by:pip install speedtest-cli...
-1
votes
0answers
37 views

Wget Script for Multiple URL's and naming each one with -O

I would like to make a wget script to download from multiple URLs and name each file individually using the -O option. (see below)wget -O file1.txt http://example.com/1243wget -O file2.txt http://...
0
votes
0answers
19 views

Linux command line interface in VirtualBox: how to automatically adjust to the window size?

Following my struggle to adjust the resolution of a CLI Ubuntu minimal guest in VirtualBox, I have been trying to find a way to automatically adjust the resolution to the window size. This should be ...
0
votes
2answers
16 views

Linux command to filter date string from file and compare it against a date

I have a file that looks like:ASDF,100090,D84,2007-12-29T01:07:35ZASDF,101090,F84,2008-01-03T01:09:36ZASDF,101190,h84,2008-01-04T01:07:31ZASDF,178915,r54,2008-01-15T01:09:21ZASDF,144290,k74,2008-...
0
votes
1answer
19 views

Monitor and Conditionally Act Upon Continuous Output of Command

In bash, I have a command running in screen that is effectively:while truedoecho $RANDOMsleep 1doneThe output of which is:123961968331641...I'd like to pipe that into something like ...
-1
votes
1answer
38 views

Command Line Asking for Key Password when SSH into EC2

I've never had a problem using SSH to access AWS EC2 instances and usually don't even need to include the key pair. In this example my EC2 instance is in a Custom VPC yet also in a public subnet with ...
0
votes
3answers
62 views

Linux command that lists processes one per line

Is there a way to restrict the output of, say ps aux | grep word, so that each process is displayed on a separate single line?I need this, because my processes descriptions take up a lot of lines ...
0
votes
0answers
21 views

Click ng-click=“validate()”>I Accept</button> from command line in linux

When I try to access the internet over a linux machine I get the following error that requires me to click on accept.How can I click it from a linux command line?<B>I accept the Terms ....&...
1
vote
1answer
58 views

SSH automatically logging out

I have spent hours and hours on a "simple and fun" task on an online learning platform.According to the site:When Bash (a popular Linux shell) starts, it executes the commands ina variety of ...
0
votes
1answer
14 views

oh-my-zsh history expansion on space or tab but not enter

In zsh with oh-my-zsh you can enter a history expansion command and press either space, tab, or enter, and it will expand out. For example:ls /path/to/some/directorycd !$<enter>would expand ...
0
votes
1answer
29 views

how can i add command to executable in linux?

so i have installed my wolfenstein and when i start the executable i want to immediately join in the server.in windows i did it in properties and after destination path i added "/Desktop/etl.exe" +...
2
votes
1answer
84 views

How to assign the user command in VI(VIM)?

I'm trying to assign the user command in VI(VIM) in Linux(CentOS).Especially, if there is one script(just text) file which is involved the pdf list file as the below, I want to view the each pdf ...
1
vote
2answers
52 views

Finding all files with extension .c, .h, and .java within my current directory

I am trying to find all the files (ending with .c,.h and .java) that are in a folder or its subdirectories beginning with "new-". This is my current command: ls -R | egrep '.[.]c$|.[.]h$|.*[.]java$' ...
4
votes
1answer
357 views

How to find a file with partially known path? `find -path` doesn't seem to work

I have a file located at folderA/folderB/myFile. This however is a relative address and I don't know where on my computer it is. myFile has a very generic name and searching just for it will give me ...
0
votes
0answers
31 views

pipe a list of files to lrztar or lrzip

I know you can pipe the output of a ``find" command to tar, and then that file to lrzip, but I also know that will reduce the compression efficiency. I triedfind . -name "*.tex" |lrztar -n -o find....
2
votes
0answers
21 views

Justify plain text ignoring double spaces

I would like to justify a plain text file (actually a markdown file) where some lines end in a double space:some lines whichcan be justified with a little careand attention. The following tough ...
0
votes
0answers
68 views

Anacron cron.daily not running my scripts

I am on Linux (Ubuntu) 16.04. I have a set of scripts in /etc/cron.daily which anacron handled. They used to run fine every day but I noticed that they were not running recently. I am not sure if it ...
0
votes
1answer
40 views

How to troubleshoot and solve /var/www/html permissions problems?

So, I am running Debian Stretch with a LAMP server and vsFTPd. When ever I upload a new file or create a new file in the /var/www/html directory with a code editing program, I am unable to view the ...
1
vote
1answer
43 views

U-Bboot won't autoboot but manual boot works fine

I've built an image for a Freescale iMX6 EVK board (ARM based), using Buildroot. It booted fine off an SD card, and I wanted to experiment with customized boot commands in U-Boot. I want to make the ...
1
vote
1answer
78 views

Rebuild massively fragmented files with a partial image and a list of their sectors

In an attempt to recover as much data as possible off of a failing 3TB HDD, I proceeded like this :I made a surface scan with HD Sentinel, which identified two small damaged areas and about 100 bad ...
0
votes
1answer
41 views

Pattern match output of terminal command (ubuntu)

How can I pattern match the output of a command?For example, I need to run the following command :nginx -VWhich returns the following :nginx version: nginx/1.10.3 (Ubuntu)built with OpenSSL 1....
0
votes
2answers
35 views

Understanding a Complex Find Command

I am working on cleaning up script code on a linux machine that a previous developer had created when I came across this command:find / -xdev -type f | egrep -v "^/etc/shadow|^/etc/random-seed|^/...
1
vote
1answer
88 views

How can I access the file system of a Samsung Galaxy S5 from Terminal (Ubuntu 15.10)?

How can I access the file system of a Samsung Galaxy S5 from Terminal (Ubuntu 15.10)?I want to manipulate the files on my phone from the Terminal of my laptop. However, I'm not sure about how to ...
1
vote
1answer
55 views

Long form command line flags in Terminal?

I hope this is the right place to ask this question. So basically, I'm currently combing through some of the more commonly used Terminal commands, and I find it really hard to remember the short form ...
0
votes
0answers
63 views

Full screen window command from Linux terminal?

On Cinnamon, you can set a hotkey to force the active window into full screen mode; many programs have a full screen toggle built in. What I'm wondering is, what's the command that's being sent? How ...
0
votes
1answer
63 views

Is it possible to create a custom flag for a system binary?

I have several SSH configurations in the file ~/.ssh/config on my local Linux machine.Is it possible to assign a new flag to an existing binary like /usr/bin/ssh such that I can execute ssh -l to ...
3
votes
3answers
125 views

How to pipe a single item from a command output into another command?

Basic example using grep (note that grep would not be my only use-case for this):$ grep -Irl "foo"path/to/directory/help.jspath/to/directory/config.jspath/to/directory/task.jsNow I want to open ...
3
votes
1answer
242 views

Using the file command to count script files

I need to use the file command to count the number of scripts a directory.I know how to get the file type using file:file testtest: Bourne-Again shell script, ASCII text executableBut how would ...
0
votes
0answers
41 views

See output command terminal history in zsh terminal

I'm in an edge situation and I really need to retrieve some generate random value I executed last week in iTerm through the command: cat /dev/urandom |LC_ALL=C tr -dc 'A-Z9' | fold -w 81 | head -n 1...
1
vote
4answers
68 views

Linux Extract Matched Text Field from File

I have a file which has many lines of the format:bc("STG1/Phone")={type=bana_pub; cbb=12.354; abb=0.0}`I'm looking to extract cbb=12.354;. Currently, I'm doing the following:cat input_file....
0
votes
1answer
36 views

What was the Linux console command to add on one user read and exec permission, and to other them too but with writing permission too? [duplicate]

Need help for the question in topic.I am trying to add these permissions for users on my practice project.I forgot what was the command for it. :(
0
votes
1answer
23 views

Unfolder and search chronologically in Ubuntu?

I have got a Ubuntu 14.04.5 LTS with a lot of folders and files. My goal is to find some old files which I think I know a naming format for them say "%A%.csv" or ".csv" or ".xls".Anyway I want ...
0
votes
1answer
54 views

Merge 2 files line by line in Linux

I have 2 files and I want to merge them line bye line.For example the content of 1st file is:python create-account.py un1 example.com 123456python create-account.py un2 example.com 123456python ...
2
votes
2answers
75 views

how to put Windows pc to sleep after specific time [duplicate]

I know that we can shut down windows after some specific time like thisshutdown -s -t <time>But how can I do the same when I want my pc to sleep after some specific amount of time?? is there ...
1
vote
1answer
62 views

sudo -u <user> <cmd> vs sudoedit

I have read on the internet that you have to use sudoedit instead of sudo vim. I understand why this is and should be used so you can't just edit root-user files.However I would like to manage a ...
0
votes
0answers
39 views

Show range of disks with lsscsi

is there any option to give a range of disks to lsscsi command?Without using grep or awkFor example:lsscsi x y z 30-38 - will give all luns from 30 to 38lsscsi x y z 30|20 - will give luns 30 ...
0
votes
1answer
62 views

How to pass command to qemu console at launch?

Is there any way to pass qemu console command directly at command launch? I mean passing for example balloon 2048M at VM boot. I'm using qemu-system-x86_64 straight from shell (no virsh or any GUI). I'...
21
votes
2answers
2k views

What is the function of the asterisk as a standalone command in Unix?

I was messing around in terminal on Red Hat Linux, and when I typed the asterisk (*) followed by return, and it executed one of the programs in my directory. Why?My best guess is that Unix treated ...
0
votes
1answer
19 views

Delete matching directories in all subdirectories

How can I remove all run-*.achilles directories in all of my subdirectories under Linux?I tried find /path -name run-*.achilles -type f -delete but it doesn't work.
0
votes
2answers
44 views

delete old dir, make new empty dir

The single bash command >| foo creates an empty file foo, no matter if it was previously nonempty, or empty, or missing. (It fails if it was read-only, or a directory.)Is there a similar single ...
1
vote
1answer
69 views

How to unzip multiple zip files into a single directory structure (e.g. Google Drive folder export)

Assume you started with an uncompressed directory A, with the following structure:$ tree AA└── inner_dir├── file1.txt└── file2.txt1 directory, 2 filesNow assume you've been given two ...
1
vote
1answer
111 views

Making log output more readable in terminal

I'm currently developing with Wordpress and monitoring its debug.log file which updates on every page re-load. If there's an error, it will add those lines to the debug.log on refresh. The three basic ...
0
votes
1answer
54 views

How to check size of a directory given by user as an argument?

I want to get the size of a directory given by user as an argument.Example:read -p "Enter the directory" targetdu -k $targetIf user gives path as ~/Documents/dir, I am getting error msg: du: ...

153050per page