Hot answers tagged

15

You could change your default shell to bash by typing in the following line: chsh -s /bin/bash You will probably need to log out and log back in for the settings to take effect. Then if you wanted to run fish, it would just be the command fish at a bash prompt. More information can be found at https://wiki.ubuntu.com/ChangingShells


13

From what I see here (Ubuntu MATE 16.04), every opened "pseudo-terminal" (or "terminal-emulator") have a special file in /dev/pts/ for each of it's windows/tabs and those files/numbers auto-increments, gets freed and are re-used. This simple script is using exactly those numbers to select a color from static configuration table. Append it to your ~/.bashrc: ...


6

If you just want the script, skip the explanation Explanation You'll have to learn at least an appropriate programming (/scripting) language, but then: Introduction; dconf and gsettings Most (if not all) of the settings, edited by Unity Tweak Tool edit the dconf database, in which many settings are stored. Editing the dconf database is best done via ...


5

If you really need to get the number of terminal you have open, go for counting the files owned by you under /dev/pts (although this might include ones opened by background processes, not by graphical terminal emulators). Alternatively, count the number of child processes of your terminal emulator(s), as shown by Jacob in the first line of his response. ...


5

In a single user situation, if we take the example of xterm, we can simply count the number of pids of xterm; xterm creates a separate pid for each and every window. gnome-terminal however runs a single pid, but the good news is that it creates a child process for each and every window and/or tab. we can retrieve these child processes by the command: pgrep ...


4

locate -b '*Summer*.jpg' The -b option tells locate to only match the file name and * in the pattern match any number of characters.


2

The question is actually to rename all dirs named with an integer, by a capital with the corresponding index(+1) from the alphabet, and vice versa: 1 -> A while e.g. C -> 3 Assuming you have no more than 26 folders on a level (number of letters in the alphabet) , the question is not that complicated, but we need to take into account a few things: ...


2

Tweaked @Jacob's script a little. First, using dconf watch / and switching hotcorners on/off in unity-tweak-tool to find out which variables(?) are being changed I have windows spread bound to bottom left corner, setting is in /org/compiz/profiles/unity/plugins/expo/expo-edge Also have workspace spread in bottom right corner, setting is in ...


2

You could use sed, it is very flexible. For instance, to print lines 2 to 5, and 4 columns starting at column 3: sed -n '2,5 s/^.\{3\}\(.\{1,4\}\).*$/\1/p' -n means do not print the line if no match 2,5 means only for lines 2 to 5 s/1/2/p means substitute 1 by 2 and print it ^.\{3\} match at start of line (^) any character exactly 3 times \( \) selects ...


2

For simplicity I would install Guake from the distro. It is a terminal that once started will run invisible and when you press f12 it will drop down from the top of the screen .. press f12 again or click off of it and it will hide. Go on working and anytime you need to access the terminal just press f12 I think this may be what you are looking for


2

You can do in your script or in your terminal: gnome-shell -r & disown This will start the program in background from the terminal and disowns the task then. NOTE: The disown command has to come directly behind the command which starts something in background, otherwise it will not work. Or if you already have started the program you want to detach ...


2

This command will find the files in /var/log that are less than 5M in size and print the size (in kilobytes) along with the file name: find /var/log -maxdepth 1 -size -5M -type f -printf '%5k %f\n' Sample output might look like: 112 syslog.6.gz 1048 messages.1 112 syslog.5.gz 120 syslog.7.gz 1216 syslog.1 How it works -maxdepth 1 tells find ...


2

XFS provides a filesystem defragmentation utility, xfs_fsr that can defragment the files on a mounted and active XFS filesystem. It can be useful to view XFS fragmentation periodically. xfs_fsr improves the organization of mounted filesystems. The reorganization algorithm operates on one file at a time, compacting or otherwise improving the layout of the ...


2

1. You can add this line using nano or vim from terminal (ctrl+alt+t): sudo nano /etc/sysctl.conf where you then scroll down and add the line by hand then press ctrl+x to end editing. You will be asked if you want to save, confirm that by pressing y and then once return to save. Same way you can reverse your changes. 2. You can add it as well ...


2

The -i option causes sudo to run the command in the shell specified by the target user's (in this case, root's) login shell, as you can confirm for example by running $ sudo -i sh -c 'echo $HOME' /root So it is telling you there is no Downloads directory in root's home. If you want to run commands as root but in the invoking user's environment, use sudo ...


2

Here ./testzenity: ligne 10: ls-al : commande introuvable it saying. No command like ls-la. it is ls -la. Hope it helps


1

To address booting into the command line, Edit /etc/default/grub with your favourite editor, e.g. nano: sudo nano /etc/default/grub Find this line: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" Change it to: GRUB_CMDLINE_LINUX_DEFAULT="text" Update GRUB: sudo update-grub For systems that use systemd, (This is an ...


1

Krename is one possible tool for what you are trying to accomplish. Install with: apt-get install krename Then: Select the files you want to rename Choose rename input files in the destination path Enter [creationdate;yyyy-MM-dd]$ in the advanced Filename template. If creation date (of the file) is not what you want, krename can also use exif data.


1

First, make sure myscript.py is executable by doing chmod +x myscript.py. Second, ensure that the shebang #!/usr/bin/env python appears as the first line of myscript.py. You then execute the script using ./myscript.py [arguments].


1

Add #!/usr/bin/python to the first line of your script. This presumes that you have python installed and runnable from /usr/bin, and that the current directory (.) is in your PATH environment variable (not the default,but you can change it in your home .profile file).


1

You can use cpio's pass-through mode with the -d option for that job: cpio -p -d DESTINATION < FILELIST This will create a copy of the whole directory structure specified in FILELIST (relative to the current working directory) underneath DESTINATION. With your example you will then have ...


1

An awk way: who | awk 'BEGIN{count=0}{ if(NR!=1){count++} }END{print count}' Explanation: In above 1 liner command, awk is used to find the count of terminal. Inside awk program, it is just checking the number of lines return by who command - 1.


1

A lot of programs will overwrite the title so you can't rely on the title being fixed or not duplicated by other windows. This is especially so with remote ssh sessions in a gnome-terminal. It still helps a lot but its not reliable enough for window managers to do matching against (which is why I think they removed it. (addition by Amias Channer)) so this ...


1

You can write-update a password to a seperate file. This works for me: echo "vpn.secrets.password:MY_PASSWORD" > /my/vpn/password nmcli con up uuid MY_UUID passwd-file /my/vpn/password If you can't do that, you can also "simulate" keyboard, run sudo apt-get install xautomation and try this script (works for me at 16.04 as well): #!/bin/bash nmcli con ...


1

shouldn't esacexport be esac export ? If the words are stick together your shell won't take it as an instruction


1

It depends, but you can easily find out... From GUI ...by right-clicking on any of the files or folders inside the drive, and choose > Properties ("Eigenschappen" in Dutch), in nautilus: As you can see, the directory is /media/jacob/My Passport Note that in commands, you need to fix the (possible) space: /media/jacob/'My Passport' From cli run: ...


1

Bit confused by your command. If you just want to divide and grep that output, | awk '{ print $1 / 33.7 }' | grep ... Will work. If you're trying to do something else (like only output parts of rows based on this calculation, you'd be better off doing the whole thing inside awk: | awk '($1 / 33.7 > 2) { print $4 }'


1

Yes you're doing it wrong. First of all, tar.gz is simply a compressed archive. Think of it as a zip file. There is no guarantee that it will have a configuration script. That said, the default name for the configuration script is configure, not config. So, the standard operating procedure to install from a source tarball is: tar xvzf foo.tzr.gz cd foo ...


1

Use * in the name part an example would be : sudo find /etc -name "*.jpg" At least that works for me (I'm a complete newbe here but i know that will work). sudo <--> to execute the command as root find <--> the commando for searching /etc <--> is the directory where you want to find the archive -name <--> option flag to ...


1

This is the bash script I use: https://gist.github.com/vzaliva/0adba7bc40e2f31a0b5f802af2a63267 Works on IBM ThinkPad X260 with Ubuntu 16.04.



Only top voted, non community-wiki answers of a minimum length are eligible