Hot answers tagged

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

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 ...


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 ...


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 ...


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.


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.


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

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 ...


2

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


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 ...


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

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 ...


2

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


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


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 ...


1

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


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 ...


1

There's couple of ways you can go about this: #1, remount /tmp with bigger size As shown in Update failing. Not enough space on /tmp sudo umount /tmp sudo mount -t tmpfs -o size=16777216,mode=1777 overflow /tmp That will give you 16 MB in/mpt . Adjust size= to how much you need #2, make temporary directory in your home $ mktemp -d -p $HOME ...


1

I'm not sure how using nautilus, usually when you need a more sophisticated file finding capabilites, most people use the shell program find. this command finds all files bigger than 100Megabytes and prints what each files size is find <the dir you want to look in> -size +100M -exec ls -lh {} \; obviously replace <the dir you want to look in> ...


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 ...



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