New answers tagged

2

You can use find, searching recursively from the current directory: find . -type f -name 'start*.ext' -exec mv -i {} foobar.txt \; Assuming the file name starts with start and has an extension .ext, renaming the file to foobar.txt. Replace these to meet your need. Searching non-recursively: find . -maxdepth 1 -type f -name 'start*.ext' -exec mv -i {} ...


2

I assume the point is to transfer the content of magento to /var/www/html. That's to say, if we had: magento ├── .bar └── foo We'd get: html ├── .bar └── foo This is annoying, but not difficult, to accomplish this with mv. You'd have to use some form of find, or enable dotglob in bash, to include the .bar. rsync is simpler. With find: find magento ...


1

They are in .local/share/libertine-container/user-data/puritine/Downloads/


1

You can do this with a bash script, example: #!/bin/bash ### project 1 ### cd /project1path/ git add all git commit -m "Automatic save commit initiated at $(date)" git push origin master --repo https://name:password@domain.name/name/repo.git ### project 2 ### cd /project2path/ git add all git commit -m "Automatic save commit initiated at $(date)" git push ...


0

Many indie games on steam are available as native Ubuntu software. sudo apt-get install steam. Steam requires a free registration.


0

To get it back: Run nautilus from Dash Browse to /usr/share/applications Drag the file org.gnome.Nautilus.desktop to the Unity Launcher That should do it. Question remains why it does not appear in the launcher if you run it from Dash. Possibly a log out / in would have changed that.


0

If you open Nautilus, you are able to see the partition with your broken installation, you can explore that and copy the files you need on your new installation.


6

Given you have sufficient permissions, the find commands will recursively change the permission bits of all files to 660 and all directories to 770 starting from the directory where it is run. As you were in /root (root's home directory) and assuming you were running as root and the owner user:group is root:root, this should not be a major problem except ...


2

That command locates all of the directories from within the directory that you ran the command and modifies its permissions. It then does the same but with files. In this case, the command changes the permissions of the directories so that you have full access but other users will not have any access. If you are the only user of the system, then this should ...


0

That first dot after the command is the root of the tree where find searches. So it affected the files of the folder you ran it, and the whole tree below it.


1

This seems to do the trick when simlinks are involved. ls -LRlh


0

Use lsblk command to print mounted partitions. This will give you something similar to this NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 698,7G 0 disk ├─sda1 8:1 0 651,9G 0 part /home ├─sda2 8:2 0 1,9G 0 part [SWAP] └─sda3 8:3 0 44,8G 0 part / sdb 8:16 0 1,8T 0 disk └─sdb1 8:17 0 1,8T 0 part sr0 ...


3

If i got that right you have the quota package installed on your machine? Then it would be the command: repquota (not sure if you need to sudo it or not) The output should look like: # repquota -a Block limits File limits User used soft hard grace used soft hard grace ...


2

You can use stat to find the size of the file in bytes and then shell arithmetic operation to multiply it by 8: echo $(( $(stat -c '%s' foo.txt) * 8 )) Replace foo.txt with the actual filename. Example: $ echo $(( $(stat -c '%s' foo.txt) * 8 )) bits 6504 bits


0

You can use Vim in Ex mode: for b in *.txt do ex -sc '%s/OLD/NEW/g|x' "$b" done % select all lines s substitute g replace all instances in each line x save and close


0

You can get the options through the menu if you go to Edit -> Preferences as well.


1

If you are new with ubuntu, I recommend you to use Playonlinux to easy setup Wine. sudo apt-get install playonlinux It has a good catalogue of popular games and Windows applications. Each Windows Application is different and may works well with an specific wine version, if you want to do it the right way, you could search for compatibility details of ...


2

xz is a compression file format. To uncompress it If your file format is tar.xz use tar xf archive.tar.xz and if your file format is xz use unxz archive.xz If you are having problem with tar xf command then you may need to install xz-utils . FYI xz-utils comes pre-installed in Ubuntu. To install xz-utils use sudo apt-get install xz-utils You can ...


3

You first have to extract the .xz file. Open the nautilus file manager, right-click the file and select Extract Here. Now click on the extracted file and in case it has a format for which all the necessary media plugins are installed, your default media player will open and start playing.


2

Yes you can use du -b FILENAME | awk '{$1=$1*8; print $1}' OR ls FILENAME -l | awk '{$5=$5*8}1'


0

Looking at the unmounted encrypted home directory of a non-logged-in user, I see some unencrypted files (well they're really directories and links): $ /bin/ls -la /home/walt total 12 dr-x------ 3 w3 walt 4096 Apr 9 22:12 . drwxr-xr-x 13 root root 4096 Sep 1 2015 .. lrwxrwxrwx 1 walt walt 56 Oct 22 2011 Access-Your-Private-Data.desktop -> ...


0

This problem appears when those folders or files are not copied completely. It's Input/Output Error. I tried to delete with Shift+Del or through commands, but these did not work. I tried right click and "Move to Trash" and it worked.


1

That's because user postgres does have not have necessary permission to read (list) the contents of directory /root/ (the home directory of user root). Normally the permission of /root/ is set as 0700 with the owner as root, so nobody else except root can check the contents and hence traverse further in the directory tree. So even if you set the owner of ...


4

Under the hood, awk does all calculations using double-precision floating point numbers. By default it prints them using printf(3) format specifier %.6g, which means that if the number is more than six digits wide it will switch over to E-notation, which is what you saw. You can work around this by setting the variable OFMT: ls -lR | awk 'BEGIN { OFMT ...


7

TL;DR: ls and awk are unnecessary for your purpose. Use du -cb or du -bs on the directory that you want to analyse. Your purpose is to Find all files find their size (in bytes) produce grand total for all of them All these actions can be performed by du. $ du -bs $HOME 2>/dev/null ...


6

The problem is that MAWK (the AWK variant installed on Ubuntu) by default prints integers bigger than 2147483647 (231-1) in scientific notation: % awk -W version mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan compiled limits: max NF 32767 sprintf buffer 2040 % printf '2147483647\n' | awk '{x += $1; print x}' 2147483647 % printf ...


3

What you see here is a way to display large numbers. For example: 1.23e+3 = 1.23*10^3 = 1230 As far as I know, you cannot turn this off, but as you wrote in your question, du does behave differently, so I would recommend to use this. Otherwise, you would have to convert the numbers.


0

Simplest one is here you only need to go to the media folder and change permissions. Follow below to commands. cd /media/ sudo chmod -R a+rX * And it's done.


1

There is a proper location. There is a standard for proper filesystem structure. Its current version has been around for over a decade, which might be news to some Linux distros. The latest version of the Filesystem Hierarchy Standard is 2.3: http://www.pathname.com/fhs/pub/fhs-2.3.html There, under the "Purpose" section of var, it explains why that's a ...



Top 50 recent answers are included