# The Linux tips thread



## Carpetsmoker (Mar 18, 2014)

My employer gave me a Dell XPS laptop with Ubuntu pre-installed; It's been ages since I've used Linux as a desktop, this is a thread where I intend to share various tips which might be useful. Anyone else is of course welcome to contribute 

Please don't turn this in a 'Linux-sucks-because-$foo-thread'.  This is already common knowledge


----------



## Carpetsmoker (Mar 18, 2014)

This has been a long-time annoyance: GNU *ls* doesn't know how to sort.

On BSD:

```
[~/ls-sort]% ls
#test    1 file   10 file  World    _under   hello
```

While with GNU ls:

```
[~/ls-sort]% /bin/ls
10 file  1 file  hello  #test  _under  World
```

Apparently, GNU ls uses the locale to make sorting 'smarter' (this is not mentioned anywhere in the manpage). To restore the normal sane behaviour:


```
[~/ls-sort]% env LANG=C ls
#test  1 file  10 file  World  _under  hello
```

you can make this in an alias:

```
alias ls 'env LANG=C ls'
```

(Shell examples assume tcsh)


----------



## Carpetsmoker (Mar 18, 2014)

Ubuntu/Debian has a *bsdtar* package, which includes *tar* & libarchive from FreeBSD; This is useful not just because some flags/options are subtly different, but also because *bsdtar* works with many different archive formats (zip, rar, 7-zip, ISO images, etc.).


----------



## Carpetsmoker (Mar 18, 2014)

Provide roughly the same output as *sockstat(1)*:


```
alias sockstat "netstat -lnptu --protocol=inet,unix"
```

(There is also a *sockstat* package, by the way. It's almost never installed by default, though).


----------



## wblock@ (Mar 18, 2014)

dd(1) units are case-sensitive on Linux, so upper-case "K", "M", and "G" are required.


----------



## Carpetsmoker (Mar 18, 2014)

To prevent the output of manpages spreading across your entire terminal width (not a good thing, IMHO), use the *MANWIDTH* environment variable:


```
setenv MANWIDTH 80
```


----------



## hitest (Mar 19, 2014)

Carpetsmoker said:
			
		

> My employer gave me a Dell XPS laptop with Ubuntu pre-installed; It's been ages since I've used Linux as a desktop, this is a thread where I intend to share various tips which might be useful. Anyone else is of course welcome to contribute
> 
> Please don't turn this in a 'Linux-sucks-because-$foo-thread'.  *This is already common knowledge*



If you would like a Linux experience that is somewhat similar to the BSDs I would recommend Slackware.  That is my Linux tip.  Slackware is known for being Unix-like.  If you are permitted I would give Slackware a try on that Dell.  §e


----------



## DeafFatalBruno (Mar 31, 2014)

Carpetsmoker said:
			
		

> My employer gave me a Dell XPS laptop with Ubuntu pre-installed; It's been ages since I've used Linux as a desktop, this is a thread where I intend to share various tips which might be useful. Anyone else is of course welcome to contribute
> 
> Please don't turn this in a 'Linux-sucks-because-$foo-thread'.  This is already common knowledge


 
u lucky bastard , ... I have a company XPS, but it does have to run a corp windows and it sort of struggles. (e.g. close the lid, but it in ur bag, and it performs well as a bag heater ,...  )


----------

