Questions tagged as ['command-line']

Questions about using the command-line interface (CLI).
Score: -2
Muhammed Özen avatar
Ubuntu Terminal Default Positions
in flag

As many of you know, whenever you open a new terminal window on Ubuntu it gets located in the upper left part of the screen. The next one is located right below it. The third one is in the upper right, the fourth one in the bottom right part of the screen. I want to add that functionality to another Linux distribution which I'm using now. I just want to know how this is handled in Ubuntu.

Also th ...

Score: 0
robotsfoundme avatar
prevent closing terminal window from stopping task started with "&"
es flag

I can start a command in the CLI interface and have it run in the background using the "&" symbol. Here, I start a command and hide all stderr and stdout and also send it to the background:

/home/$USER/xctu/XCTU-NG/app &> /dev/null &

When I close the terminal that ran this command, the program also quits. How do I close the terminal window that ran this command without quitting the prog ...

Score: 0
reducing activity avatar
Any CLI HTML validator running locally and detecting dead internal links
cn flag

I am looking for any HTML validator that fullfils following requirement

  • runs locally on a local files (without internet connectivity)
  • detects dead internal links
  • does not detect working links as invalid
  • runs in a command line

I am looking for a tool that would detect <a href="nonexisting_local_file.html> <img src=not_existing_file.png> and so on.

Score: 0
Masked Man avatar
Getting aggregate memory usage of a Linux process?
ng flag

How is it possible to aggregate memory usage of a Linux process and all its children in human readable format?

I tried this link and even using cat /proc/$pid/status but the latter had 18GB of VirtualMemory for chrome on my machine which only has 12GB of RAM (I know it is virtual and can be higher than physical RAM amount). But I need to know the physical memory usage of all chrome instances at on ...

Score: 0
magicmomo123 avatar
Malformed entry 64 in list file /etc/apt/sources.list (Component)
us flag

I am running ubuntu 20.04, and I am trying to follow this tutorial for downloading the realsense driver https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md.

However, I am getting this error in terminal when running this command

 sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $ focal main" -u

E: Malformed entry 64 in list file /etc/apt/sou ...
Score: 1
Mahmoud avatar
Searching for and deleting files with a certain extension or ending with a number
cn flag

I'd like my script to find a certain file type and delete it.

I know that find path/to/directory/ -type f -name '*.ext' -delete will find and delete all files with the extension.

Now I'd also like to have my script remove any file ending with a number regardless of the extension, as well as the files ending with the extension.

I tried the following commands with no success:

find path/to/directory/ -type  ...
Score: 3
Cas avatar
How to only remove duplicate lines if they're immediately after each other in the file
in flag
Cas

Lets say I have the following file:

$ cat test.txt
a
-----
b
-----
-----
c
-----
-----
-----
d
-----
e
-----
-----

Now I want to remove all the -----, but only if they're repeating after each other. So the result should look like this:

a
-----
b
-----
c
-----
d
-----
e
-----

I tried grep -Pvz -- "-----\n-----", but that didn't work.

Score: 0
Omar Faruk avatar
The File or Directory Is Corrupted and Unreadable
es flag

I just sent a ubuntu 21.04 iso file from ubuntu desktop to a ntfs hdd in a folder. but later when i tried to open the folder it's giving the error message"The File or Directory Is Corrupted and Unreadable"

Score: 1
Sun Bear avatar
How to enable/disable Canonical Livepatch in software_properties_gtk via command line?
cn flag

a

The above picture shows Canonical livepatch setting in software_properties_gtk. How do I enable/disable the Canonical Livepatch via command line?

Score: 1
Sun Bear avatar
How to use software-properties-gtk --enable-component=ENABLE_COMPONENT?
cn flag

I would like to enable or disable certain options in the application software-properties-gtk via command-line.

Examples of the options that I am interested to control via command-line are shown below:

a b

I suspect the command software-properties-gtk --enable-component=ENABLE_COMPONENT would allow me to implement what I want. However, manpage does not elaborate what values can be used to replace ENAB ...

Score: 0
Nicholas Saunders avatar
how to use testng directly from bash?
mx flag

I'm not seeing why java cannot find App as it's explicitly added to the classpath:

nicholas@mordor:~$ 
nicholas@mordor:~$ java -cp /usr/share/maven-repo/org/testng/testng/debian/testng-debian.jar:/home/nicholas/NetbeansProjects/testng_gradle/src/main/java/testng_gradle/App /home/nicholas/NetBeansProjects/testng_gradle/app/src/test/java/testng_gradle/AppTest.java /home/Nicholas/NetbeansProjects/tes ...
Score: 0
Amir133 avatar
ubuntu server 18.04 set dns server name without change after reboot
kr flag

I am new in ubuntu.

When installing Ubuntu, I set the network settings manually and manually set up the IP and DNS server in installation wizard , but now I after installation complete can not change the settings (especially DNS) in installed ubuntu. In other words, I do not know where these settings are stored. I tried different solutions but none of them worked. Can you guide me? Thanks

OS : ubuntu  ...
Score: 1
Nautilus: "Open With Other Application" doesn't shows snaps
in flag

I can open app with snap run jerry but arguments after that aren't recognized as I understand... snap run jerry ./a.pgn

"open with other application" shows as

/usr/bin/nautilus --gapplication-service

Snap:

snap version 
snap    2.51.3
snapd   2.51.3
series  16
ubuntu  18.04
kernel  5.4.0-80-generic

Nautilus:

nautilus --version
GNOME nautilus 3.26.4
Score: 0
noobplusplus avatar
ubuntu 21.04: /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?
ph flag

I have bought a windows laptop yesterday, I installed fresh ubuntu 21.04. The I installed VS code from Ubuntu Software. Now the sudo command doesn't work in vscode integrated bash terminal. I get following error message:

sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

but sudo works perfectly fine in ubuntu b ...

Score: 6
Head with a weird behavior
ua flag

I have downloaded a warc file from Common Crawl in Ubuntu 18.04. After decompressing it with gzip, I've tried to get a segment of the file using head. I first tried:

head -c 29 CC-MAIN-20210620114611-20210620144611-00436.warc

It produced the expected result, outputting the first 29 bytes of the file:

WARC/1.0
WARC-Type: warcinfo

But, if instead of 29, I use 30, it produces a result I was not expecting: ...

Score: 2
jibjab3344 avatar
How do I increase the text size in an app on ubuntu 18.04?
us flag

I had to re-download the Brackets text editor amongst a few other apps but when I open it up the text in the menu, buttons in the app text in the app itself are really small, I think there's a command line way of doing it.

Here is a screenshot.enter image description here

Score: 0
puma avatar
Cmake fails to build an executable
in flag

Trying to build a program with Cmake Results in:

me@ubuntu-20-04:~/Downloads/UxPlay/build$ cmake ..

-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to  ...
Score: 2
Daniel125 avatar
"/usr/bin/python: No module named virtualenvwrapper" error when opening terminal
th flag

I'm using Ubuntu 20.04 (clean installation, I did not upgrade from a previous one) and when I open a new terminal (simply by Ctrl+Alt+T), it always starts with the output shown below (also shown in the following screenshot):

/usr/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtuale ...
Score: 0
Shell script that runs python script again when it's finished
co flag

I want to create a sh script that runs python script python core.py and when the script is finished pause for some milliseconds and run it again. And so on and on. Not sure where to start - any help appreciated.

Score: 0
Sayan Dey avatar
login shell check is not working in .profile
vn flag

Ubuntu 20.04, 5.8.0-63-generic, gnome-shell, gdm3

My login shell is set to /bin/sh

and I have this line in my $HOME/.profile file:

shopt -q login_shell > /dev/null 2>&1 || export SHELL=/bin/zsh

Now from my understanding export SHELL=/bin/zsh should not be executed on login right? because it is a login shell so shopt -q login_shell > /dev/null 2>&1 is True.

But I am getting $SHELL as / ...

Score: 0
ankur patel avatar
hdfs normally working but with sudo it shows command not found
th flag

I am trying to install hadoop3.1.1 and i have set ./bashrc file and all the other necessary files. while applying hdfs i am facing this situation shown in the picture. this image shows commands I have performed.

Score: 0
mohamed rabiaa avatar
why can't I open my Android Studio project on XUbuntu?
cn flag

I am an Android developer and I use Android studio to build apps, I am also newbie in Linux and I have installed Xubuntu since 2 days, every time I try to open a project (after restaring my pc) the path of the project is not recognizable by Xubuntu and Android Studio gives me a dialog with this error message: "The path /media/mohamed/LocalDisk/AndroidProjects/MyChatApp doesn't exist. if it is on a remov ...

Score: 0
YQ002lc2 avatar
Ubuntu Server console brightness
cd flag

I'm familiar with

xrandr --output Monitor_name --brightness 0.6

for adjusting screen brightness in graphical environments.

Is there a similar tool to adjust brightness for ubuntu server's console?

Thanks.

Score: 1
dotfile failed to read file
de flag

When I create a file without a dot (hidden) and use gh, (Github cli), to create a gist, it works. But when I change it to a hidden file it fails to read a file.

# I can create a gist with a normal file.
shinichi@shinichi-Ubuntu:~$ gh gist create /home/shinichi/testing-gh
- Creating gist testing-gh
✓ Created gist testing-gh
https://gist.github.com/b2cd617f8cf35dc54986f5855ae92b1f

# checking permissions
 ...
Score: 0
Taufiq avatar
Unable to Switch back to running desktop mode from TTY in 18.04
tz flag

Tried following thing but did not work. Any help is highly appreciated.

Ctrl+Alt+F7

sudo dpkg --configure -a
sudo apt-get update
sudo apt-get upgrade -y
sudo reboot
sudo apt-get update
sudo apt-get install --reinstall ubuntu-desktop
sudo apt-get install unity
sudo shutdown -r now
Score: 1
Husker avatar
extract only a subfolder from a zip file without the path
us flag

I have a little problem! I have a zip file "Backup.zip"; in this zipfile I have: /Users/USERNAME/Pictures

The Picture directory has files and directories.

I need to extract only the Picture folder but without /Users/USERNAME/.

I have tried:

unzip Backup.zip '/Users/USERNAME/Pictures/*' -d home/USERNAME/Pictures/

and

unzip Backup.zip '/Users/USERNAME/Pictures/' -d home/USERNAME/Pictures/

and

unzip  ...
Score: 1
John Smith avatar
How do I configure a command line email client to send and receive email from the command line in Ubuntu?
cn flag

I have been exploring command line email clients for a while now and it is not clear to me which would be the most standard tool and set-up.

I want to send emails from the command line without opening a specific GUI application like Mutt, and I also would like to save my email inbox on my filesystem, search through it for a list of particular emails, and access those emails for reading in some wa ...

Score: 1
Helex Chong avatar
Question about alternating commands every minute in Cron
us flag

I've been editing my crontab with crontab -e -u, and this is the contents:

*/1 * * * * export DISPLAY=:0 && xset dpms force off 

*/1 * * * * export DISPLAY=:0 && xset dpms force on

How do I make the on time holding for 1 minute, so the display is off for 1 minute then on 1 minute?

Score: 1
Askerman avatar
Allowing a sudo command to run without needing password
us flag

I have the following command:

sudo service cron start

When I type it into the terminal, it asks me for a password, just as it should. But I need for users (or if all users aren't possible, then at least my user) to be able to run this specific command without needing to put in any passwords. I googled around, even looked at similar questions here and found about visudo, so I gave it a try, and put thi ...