Skip to content

Commit cb3948c

Browse files
Create get-info.md
1 parent dbb9ef9 commit cb3948c

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

cheatsheets/shell/get-info.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Get info
2+
3+
4+
## which
5+
6+
Alias:
7+
8+
```console
9+
$ which ls
10+
ls is an alias for ls -G`
11+
```
12+
13+
Function:
14+
15+
```console
16+
$ which upgrade-deps
17+
upgrade-deps () {
18+
if [[ -n "$(git status --porcelain)" ]]
19+
then
20+
...
21+
```
22+
23+
24+
## Type
25+
26+
```console
27+
$ type upgrade-deps
28+
upgrade-deps is a shell function from /Users/mcurrin/.aliases`
29+
```
30+
31+
```console
32+
$ type ls
33+
ls is an alias for ls -G
34+
```
35+
36+
37+
## ln
38+
39+
Check if a symlink is valid.
40+
41+
If valid:
42+
43+
```console
44+
$ ln -s abc def
45+
$ ln def
46+
ln: ./def: File exists
47+
```
48+
49+
If not valid:
50+
51+
```console
52+
$ ln -s abc def
53+
$ rm abc
54+
$ ln def
55+
ln: def: No such file or directory
56+
```

0 commit comments

Comments
 (0)